mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3474] Grok CLI provider: every request pays ~10s of repo indexing when Marinara runs from a git checkout #1877
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1877
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @myaiexp on GitHub (Jul 11, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3474
Problem
The Grok CLI provider spawns
grokwith its working directory set toDATA_DIR/grok-cli. The grok CLI walks up from its cwd to the nearest.git, and indexes the entire working tree of that repository at startup of every one-shot call.When Marinara runs from a git checkout (source installs, contributors, self-hosters),
DATA_DIR/grok-clisits inside the Marinara repo — so every chat generation and every agent/tracker request re-indexes the whole checkout before the API call even starts.Docker and installer deployments have no
.gitabove the data dir, which is why this is easy to miss.Measurements
Identical one-line prompt (
Say OK and nothing else.), grok 0.2.14, Linux:data/grok-cli(empty, inside the Marinara checkout)An
straceof the slow case shows 45,000+ file opens (all ofpackages/client,packages/server, docs, android…) before the CLI contacts the API.End-to-end through Marinara's
POST /api/connections/:id/test(a realReply with OK.request): 12.1 s before the fix, 5.4 s after.No CLI flag disables the discovery (
--verbatimdoes not; a stub empty.gitdirectory is not accepted as a repo boundary — verified).Fix
Move the scratch cwd from
DATA_DIR/grok-clito the OS temp dir (os.tmpdir()), which is never inside a git checkout. A uid suffix keeps per-user paths distinct on shared hosts. Prompt files already live outside the cwd, so nothing else changes.As a side benefit, the CLI's workspace discovery can no longer see anything under
DATA_DIRat all, which strengthens the existing "keep prompt transcripts outside--cwd" isolation from #3464.PR incoming (owner: @myaiexp, agent-assisted).
🤖 Generated with Claude Code
@SpicyMarinara commented on GitHub (Jul 11, 2026):
Thank you for the PR!