Skip to content

xAI grok-4.6 completions streams stall at the 120s idle watchdog and subagent reviews are marked failed despite completed thinking #4747

Description

@nerdy2quant

Summary

xai/grok-4.6 subagent reviews (architect / critic) repeatedly die with:

OpenAI completions stream stalled while waiting for the next event

The reviewer has already finished the review in thinking. The official assistant text never arrives, so the parent session receives only failed and cannot apply the review.

This is the xAI / openai-completions counterpart of #4096 (Anthropic max-reasoning vs the shared 120s idle watchdog). #4096 is closed and Anthropic-specific. The same watchdog still kills Grok xhigh after first-token / first-thinking progress.

Environment

  • Host: macOS darwin 25.5.0, arm64 (Apple M4 Pro)
  • GJC binary: /opt/homebrew/bin/gjc (local build dated 2026-08-20)
  • Parent + reviewers: xai/grok-4.6, api: openai-completions, thinking xhigh
  • Workflow: superpowers-brainstorming independent spec review, then superpowers-writing-plans critic
  • Repo: private product session, not a GJC source checkout
  • PI_STREAM_IDLE_TIMEOUT_MS, PI_OPENAI_STREAM_IDLE_TIMEOUT_MS, and GJC_OPENAI_STREAM_IDLE_TIMEOUT_MS unset

Reproduction

  1. Run superpowers-brainstorming on a non-trivial spec with default grok-4.6 / xhigh.
  2. Dispatch read-only task(agent="architect") for the spec review.
  3. The reviewer reads files and starts writing ## Spec Review in thinking.
  4. After ~120s of no further SSE events, the turn ends as stopReason: error.
  5. Retrying the same review dies the same way. A later critic plan review dies the same way.

Evidence

Three consecutive reviewer turns in one session:

Subagent Role TTFT Duration Result
0-GrokSpecReview architect 1683ms 141813ms error, usage all zeros
1-GrokSpecReview2 architect 1173ms 132381ms error, usage all zeros
2-GrokPlanReview critic 1435ms 121933ms error, usage all zeros

Canonical error on all three:

stopReason: error
errorMessage: OpenAI completions stream stalled while waiting for the next event
api: openai-completions
provider: xai
model: grok-4.6
usage: input=0 output=0 cacheRead=0 cacheWrite=0 totalTokens=0

The first two turns already contained a completed review in thinking, including ## Spec Review, Status: Issues Found, and a concrete finding about --model default vs test_main_cli_knobs.py. There was no official text part, so the parent inspect/await path reported:

0-GrokSpecReview — failed
1-GrokSpecReview2 — failed

The parent then cancelled the still-running second reviewer and proceeded without an independent review. The review content was recoverable only by manually reading the child jsonl after the user asked why it failed.

GPT-family reviewers on openai-codex-responses do not reproduce this in the same workflow, because they keep emitting reasoning/stream events during thinking. Grok xhigh goes silent after a fast TTFT.

Why this is not just #4096

#4096 already established:

  • shared default is DEFAULT_STREAM_IDLE_TIMEOUT_MS = 120_000
  • Anthropic can open a thinking block, then stay silent long enough to trip the watchdog
  • workaround: export PI_STREAM_IDLE_TIMEOUT_MS=300000
  • expected fix: Anthropic-specific 300s default

This report adds a still-open provider path:

So even if the user knows the env workaround, a stalled reviewer still wastes the completed review.

Expected behavior

  1. openai-completions / xAI should not use the 120s Anthropic-era default for xhigh reasoning gaps. A provider-specific default (300s, matching Anthropic max-reasoning streams repeatedly abort at the 120s idle watchdog #4096) or a documented GJC_OPENAI_STREAM_IDLE_TIMEOUT_MS default would avoid the false stall.
  2. If a subagent turn still stalls after thinking already contains a structured review (## Spec Review, status, findings), promote that thinking to the parent as a successful/partial result instead of failed with no payload.
  3. Parent subagent inspect/await should include errorMessage and the recovered thinking excerpt, not just failed.

Workaround

  • Send only the reviewer (architect / critic) to a GPT-family model.
  • Or lower Grok reasoning below xhigh.
  • Or set PI_STREAM_IDLE_TIMEOUT_MS=300000 / GJC_OPENAI_STREAM_IDLE_TIMEOUT_MS=300000 if those still apply to openai-completions.

The first workaround is what we will use locally. The second/third do not fix the lost-review promotion bug.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions