Skip to content

Grok turns held open by stalled background subagents show no waiting state, and steering only supersedes attempts #17159

Description

@Mkassabov

What happened

threads seem to just stall; they will go minutes on end without outputting anything and when you steer the agent it says something completed 10 minutes ago and it never started the next thing … sometimes queues just dont send message when an agent is idle

New user on Nightly, desktop app plus the Android app over Tailscale, Grok provider. Threads look idle (the agent has answered) but stay "working" for up to an hour. Steering doesn't unstick them, and queued messages don't send.

Diagnosis

When a Grok turn spawns background subagents, AcpAdapterV2 keeps the root turn open after session/prompt returns (deferFinalizeForBackgroundWork: true in GrokAdapterV2.ts) until every subagent ends. That's intended. But if a subagent's model stream stalls, the only thing that ends the hold is the Grok CLI's own 3600 s inference idle timeout. For that whole time:

  • The UI gives no sign that the turn is waiting on subagents. The answer is on screen and the thread still says "working".
  • Steering interrupts and restarts the attempt (steering_restart). The new attempt replies in seconds and then hits the same hold. Each completed attempt is marked superseded and folded away, so steering makes history look like it's disappearing, without ever releasing the hold.
  • Queued follow-ups stay queued, because the run still counts as active.

In the observed thread, run 17 went through 6 attempts over 62 minutes. Its two subagents had sent inference requests at 08:50:44 and 08:51:47 that never received a chunk. Grok ended them at 09:51:51 (idle_timeout), and the run finalized at 09:51:58. Full timeline is in #15489.

Steps to reproduce

  1. Grok provider (seen with a custom-gateway model; any model stream that stalls should do).
  2. Ask for work that makes Grok spawn_subagent in the background.
  3. Have a subagent's inference stall: no chunks and no error (for example, a gateway that holds the connection open).
  4. The root agent finishes its reply. The thread stays "working".
  5. Steer: a new attempt starts, replies, and holds again. The previous attempt folds as "Superseded attempt".
  6. Queue a follow-up: it doesn't send until the subagent dies (up to 1 h).

Version

0.0.46-nightly.20261008.2813 (30cc788)

Environment

Linux x64 (CachyOS, kernel 7.1.8), Node 26.8.2, T3 desktop app (AppImage) plus the Android app over Tailscale; Grok CLI 1.0.46 (2765805b9442)

Evidence

# Grok unified.jsonl (subagent)
08:50:44.259Z shell.turn.inference_start {"loop_index":10}
09:51:51.297Z shell.turn.inference_failed {"kind":"idle_timeout","message":"inference idle timeout after 3600s with no chunks"}
09:51:54.484Z subagent failed {"success":false,"cancelled":false}
# Grok unified.jsonl (root, attempt 5)
09:32:20.133Z shell.handle_prompt.done {"prompt_id":"t3-xai-prompt-5","ok":true}
# T3: provider turn 21 started 09:32:05, last item 09:32:20, held until steered at 09:50:04
# orchestration_v2_projection_subagents: both rows status=running 08:50:08 → failed 09:51:55

Related issues

#15489: same symptom. Its open question (why the turn stayed open) is answered with the trace in a comment there. This issue is the product ask: surface the hold and don't let steers supersede held attempts. #15888: a Grok delegated child stays running. #16987: queued messages missing or reordered. PR #17144: Grok runs finishing when background commands end (a different hold source).

Fix applied or workaround

None applied. Workaround: when a thread looks stuck after an answer, check for running subagents and cancel them instead of steering.

Filed by

Claude Code (Opus 5.5) via t3 triage

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions