Skip to content

fix(code): pass hook-fix and review prompts via argv, not stdin - #11

Merged
danii1 merged 1 commit into
mainfrom
fix/headless-agent-prompt-args
Aug 18, 2026
Merged

fix(code): pass hook-fix and review prompts via argv, not stdin#11
danii1 merged 1 commit into
mainfrom
fix/headless-agent-prompt-args

Conversation

@danii1

@danii1 danii1 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

devintern DAN-6 committed successfully, then died while auto-fixing the pre-push hook:

Error: Device not configured (os error 6)
❌ Grok Build exited with code 1 while fixing git hook errors

That is ENXIO. Grok Build (and other TUI-first CLIs) open an interactive session unless the prompt is passed as a flag (grok -p, kimi --prompt, goose -t, …). The hook fixer still piped the prompt on stdin with stdio: ["pipe", "pipe", "pipe"], so Grok tried to attach a TTY and crashed.

Does this affect other harnesses? Yes.

Harness Without a prompt on argv
Grok, Kimi, Goose, Qwen, Antigravity, Pi Open TUI → Device not configured / hang
Codex, Cursor, Opencode, Cline Prompt never arrives (positional)
Claude Code Often still accepts stdin, but the rest of the CLI already uses -p

The main implement / clarity / estimate path was already fixed (CHANGELOG 2.1.0). This PR updates the leftover spawn sites:

  • git hook fixer (this error)
  • address-review
  • auto-review loop (--auto-review)
  • webhook review runner

All four now share buildHeadlessAgentArgs + ignored stdin.

Test plan

  • bun test packages/code/tests/agent-spawn.test.ts packages/code/tests/git-hook-fixer.test.ts
  • Re-run a Grok hook-fix after a known pre-push failure and confirm it launches with -p instead of crashing immediately
  • Optional: devintern address-review <pr-url> with AGENT_HARNESS=grok

TUI-first harnesses (Grok Build, Kimi, Goose, Qwen, Antigravity, Pi)
open an interactive session when no prompt flag is set, then exit with
ENXIO / "Device not configured" when stdin is a pipe. Positional CLIs
(Codex, Cursor, Opencode) never saw the piped prompt either.

The main implementation path already used buildPromptArgs. Hook fixer,
address-review, auto-review, and the webhook review runner now share
the same headless argv + ignored-stdin spawn.

Signed-off-by: Daniil Pokrovsky <daniil.pokrovsky@gmail.com>
@danii1
danii1 merged commit 5bb536e into main Aug 18, 2026
1 check passed
@danii1 danii1 mentioned this pull request Aug 18, 2026
4 tasks
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