mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3463] Grok CLI subscription: E2BIG on long transcripts; context hard-capped at 32k #1871
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#1871
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/3463
Originally assigned to: @SpicyMarinara on GitHub.
What happens
The Grok CLI subscription provider passes the entire flattened transcript to the CLI as one inline
-pargument (grok-subscription.provider.ts). Operating systems cap the size of a single exec argument — 128 KiB on Linux (MAX_ARG_STRLEN), roughly 32 KiB for the whole command line on Windows — so once a chat's transcript outgrows that, the spawn itself fails (E2BIG/ "Argument list too long") before any request is made.The provider's 32k context ceiling (
GROK_CLI_DEFAULT_CONTEXT_TOKENS, enforced innormalizeGrokCliContextWindow) tracks that argv ceiling almost exactly (32k tokens × the 4-chars-per-token estimate = 128,000 chars), but it counts characters while the OS counts bytes — so multibyte-heavy chats (CJK, emoji-dense roleplay) can still blow the limit under the clamp. It also caps subscription users at 32k context even when their configured model supports far more.Reproduction
Linux, grok CLI 0.2.14. Any chat whose flattened prompt exceeds 131,072 bytes: the request fails at spawn. Verified directly: a 157 KB prompt fails with the provider's inline
-pshape and completes when delivered via--prompt-filewith the otherwise identical flag set.Suggested fix
The grok CLI accepts
--prompt-file <PATH>. Writing the prompt to a temp file in the existing grok scratch dir and passing the path removes the argv limit entirely — and with it, the reason for the 32k clamp. PR to follow.@SpicyMarinara commented on GitHub (Jul 11, 2026):
Thank you for tackling it! Remind me if you already have a Contributor role on my Discord?
@myaiexp commented on GitHub (Jul 11, 2026):
Just joined, sent a message in general