Repository navigation
fix: grok headless runs die on first gated tool; map asking modes to auto and surface run errors in thread_status - #4
Merged
currentbits merged 1 commit intoAug 14, 2026
Conversation
…auto Headless grok (-p) has no permission prompt channel (no --permission-prompt-tool / stream-json input like claude), so --permission-mode default auto-cancels the first tool that needs approval and the run ends with result subtype error_during_execution (issue #3). Map default and acceptEdits to grok's non-prompting auto mode; plan and bypassPermissions never prompt and pass through. thread_status now returns lastError (the run's 'Run error: ...' event) when a thread is failed, so orchestrators can see why a run died. Fixes #3 Co-Authored-By: Claude Fable 5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
currentbits
deleted the
coder/grok-provider-runs-fail-immediately-afte-f92fae
branch
October 3, 2026 16:07
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause (issue #3)
Grok-provider threads run the grok CLI headless (
-p), and headless grok has no permission prompt channel — nothing like claude's--permission-prompt-tool stdio/ stream-json stdin control protocol exists. Solenta spawned it with--permission-mode default("Ask first"), so the first tool call that needed approval was auto-cancelled by the CLI (User cancelled the execution for tool …) and the run ended withresult subtype error_during_execution.The issue's "before making any tool call" premise was slightly off: the failed runs in the store did make tool calls — read-only tools (
read_file,grep, safegit status) are auto-approved even in default mode — and every run died at the first gated tool (search_replace, MCPuse_tool). Reproduced live: default mode →error_during_execution;--permission-mode auto→ same write task completes withresult subtype success.What changed
buildArgsmaps the asking modes (default,acceptEdits) to grok's non-promptingauto;planandbypassPermissionsnever prompt and pass through unchanged. Same spirit as kimi one-shot turns, which also cannot ask.thread_statusnow returnslastError(the run'sRun error: …event text: result subtype / exit code / stderr tail) when a thread isfailed, so orchestrators can see why a run died, not just that it did — the issue's second ask.lastErrorcase.Other providers (checked as part of this work)
workingfor a human. Fork unattended claude workers withacceptEdits/bypassPermissions.execnever prompts) but may silently run with a read-only sandbox; unverified live (account at usage limit), no codex thread has ever run. Follow-up if needed: add-s workspace-writeto codex buildArgs.Verification
node --teston grok/providers/providers-set/reasoning-effort/workflow suites → 69/69 passelectron/test/orch-server.test.jshandler suite passes incl. the newlastErrortest (HTTP-listener subtests fail identically on a clean checkout in this sandbox — pre-existing, unrelated)npm run typecheck→ exit 0default, succeeds inautoFixes #3
🤖 Generated with Claude Code