Skip to content

feat: add Grok as a --guest runtime for Codex $cc commands - #19

Closed
CBEPX wants to merge 1 commit into
mainfrom
feat/grok-guest
Closed

feat: add Grok as a --guest runtime for Codex $cc commands#19
CBEPX wants to merge 1 commit into
mainfrom
feat/grok-guest

Conversation

@CBEPX

@CBEPX CBEPX commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Summary

Add an opt-in Grok guest path to the Codex-hosted Claude Code companion so $cc:review, $cc:adversarial-review, $cc:rescue, and $cc:setup can run Grok instead of Claude Code.

  • New --guest <claude|grok> flag (default claude). CC_GUEST is the env fallback; the CLI flag wins.
  • Grok turns spawn grok --prompt-file … --output-format json --always-approve, not claude -p and not codex exec.
  • Reviews keep the existing isolated git worktree, then restrict Grok to read_file,grep,list_dir,web_search,web_fetch.
  • Claude remains the default path. Existing Claude model aliases, MCP git, sandbox settings, and job titles are unchanged unless --guest grok is set.
  • --user-mcp-tool / --allow-project-mcp-servers stay Claude-only and error on --guest grok.
  • Grok does not inherit Claude aliases such as opus. Omit --model to use Grok's default, or pass a Grok model ID.

Please review this PR with Codex and Claude. Do not merge until both reviews land.

Test plan

  • npm test in the worktree: 792/792 pass (770 previous + 22 new guest/grok-cli/companion tests)
  • npm run typecheck
  • npm run lint
  • Reviewers: hermetic fake-grok coverage is in tests/grok-cli.test.mjs; live $cc:review --guest grok --wait is intentionally not run here (paid API)

Hermetic coverage added:

  • resolveGuest default / env / override / rejection
  • buildGrokArgs uses --prompt-file + json, never Claude stream-json / --allowedTools
  • runGrokTurn writes the prompt file and parses { text, sessionId, modelUsage }
  • companion --help documents --guest
  • review --guest chatgpt fails with Unsupported guest before git/Claude

Codex can now run Grok instead of Claude Code via `--guest grok` or
`CC_GUEST=grok`. The default guest remains Claude.

Grok turns use `grok --prompt-file` with `--output-format json` and a
read-only tool allowlist for reviews. Claude MCP tools stay Claude-only.
@CBEPX

CBEPX commented Sep 3, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #36 — same Grok-guest feature, rebased onto v1.7.3. This branch was cut from v1.6.1 and is DIRTY against current main.

@CBEPX

CBEPX commented Sep 3, 2026

Copy link
Copy Markdown
Owner Author

Closing in favor of #36.

@CBEPX CBEPX closed this Sep 3, 2026
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.

1 participant