Skip to content

fix(grok): pass --rules as system prompt text, not path - #97

Merged
rimusz merged 2 commits into
mainfrom
termo/grok-rules-text
Nov 20, 2026
Merged

rimusz merged 2 commits into
mainfrom
termo/grok-rules-text

Conversation

@rimusz

@rimusz rimusz commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Bug

Grok CLI 1.0.89 --rules takes the system prompt as text. atr passed the path to system.md, so atr's system prompt never reached Grok. Seen on prod Mini session 970c35f0.

Fix

Read system.md and pass those bytes as one argv element. Refuse NUL or over-long text before spawn. Other system_prompt_flag values are unchanged (still a path).

Tests

993 pass on the branch (Cursor cloud agent bc-b176bf6b), including grok_rules_argv_is_file_text_not_path.

Docs

Docs updated for the Grok --rules text contract.

Branch termo/grok-rules-text at abc7aa046da9062f6a7496a5e3dfe00b3f064f9e.

cursoragent and others added 2 commits November 20, 2026 06:14
Grok Build 1.0.89 takes rules text on --rules, not a file path.
Read system.md and pass those bytes as one argv element so the
system prompt reaches the model.

Co-authored-by: rimusz <rimusz@users.noreply.github.com>
Linux still caps one --rules argument at 32 pages. macOS uses ARG_MAX
only, so the page-size binding is computed on Linux alone.

Co-authored-by: rimusz <rimusz@users.noreply.github.com>
@rimusz
rimusz merged commit d7a7a8c into main Nov 20, 2026
10 checks passed
@rimusz
rimusz deleted the termo/grok-rules-text branch November 20, 2026 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants