mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #3475] [MERGED] fix(server): keep Grok CLI scratch cwd outside any git checkout #5956
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#5956
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3475
Author: @myaiexp
Created: 7/11/2026
Status: ✅ Merged
Merged: 7/11/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/grok-cli-scratch-tmpdir📝 Commits (2)
ab862d3fix(server): keep grok CLI scratch cwd outside any git checkoutb184e97Address CodeRabbit scratch directory review📊 Changes
1 file changed (+20 additions, -5 deletions)
View changed files
📝
packages/server/src/services/llm/providers/grok-subscription.provider.ts(+20 -5)📄 Description
Linked issue
Closes #3474
Why this change
The Grok CLI provider spawned
grokwithDATA_DIR/grok-clias its working directory. On source installations inside a Git checkout, Grok walks upward to the repository root and indexes the entire Marinara tree for every one-shot chat, tracker, or agent request. Measurements showed 45,000+ file opens and roughly 10 seconds of avoidable startup CPU per call.Docker and installer deployments generally hide the problem because their data directory has no Git repository above it.
What changed
mkdtemp, preventing another local user from pre-creating the path or substituting a symlink.Alternatives tested by the contributor:
--verbatimdoes not skip discovery; a stub.gitdirectory is not accepted as a repository boundary;git initworks but adds an unnecessary Git binary dependency.Validation
pnpm checkpasses locallyCONTRIBUTING.mdAutomated validation completed:
pnpm checkpnpm-validatecontainer-build-testManual verification notes
Contributor measurements for an identical one-line prompt using Grok 0.2.14 on Linux:
grok -poutside any repositorygrok -pfromdata/grok-cliinside the checkoutBefore merging, manually verify chat generation and tracker/agent runs with an authenticated Grok CLI connection and confirm its scratch directory is created under the OS temporary directory.
Docs and release impact
No version bump is included. The implementation is isolated to the Grok subscription provider.
UI evidence (if applicable)
Not applicable; this is a server-only provider performance and security fix.
Ownership: @myaiexp (agent-assisted).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.