Repository navigation
fix(grok): end the turn when an auto-backgrounded shell command finishes (fork patch on nightly 2819, board #16214) - #5
Draft
MattRiddell wants to merge 1 commit into
Conversation
When Grok moves a foreground run_terminal_command to the background after its 15s limit, it reuses the tool call id (call-<uuid>-<n>) as the task id. T3 registered that id as running background work, but TaskOutput hydration only accepted a bare UUID, so the completion never matched. The tool row stayed running, hasDeferredBackgroundWork stayed true and the turn never ended until the hung-turn timer stopped the thread. Accept the call-id form in extractXAiBackgroundTaskCompletion (result task_id, task header and request ids). Subagent and monitor parsing keep the UUID-only match. Evidence: lcr-bench 2026-10-08/09, 26 of 28 grok arms with call-id tasks hung; 0 of 13 arms with UUID or no background tasks hung. Board pingdotgg#16214. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Board pingdotgg#16214 (from pingdotgg#16211). Matt, q3442 (Telegram 2026-10-10T00:51:58Z, "q3442: 1"): patch our T3 build; controller swaps it in at the next T3 restart; re-apply on each T3 upgrade. Staged as
~/.local/lib/t3-20261008-2819-pr10m-fix16214(on top of #4), sha256 0ab73c79308719bc; install packet on board pingdotgg#16214.What
XAiAcpExtension.extractXAiBackgroundTaskCompletionnow accepts Grok's call-id task formcall-<uuid>-<n>as well as a bare UUID: in the TaskOutputResult.task_id, the=== Task <id> ===header and the requestedtask_ids. Subagent and monitor parsing keep the UUID-only match.Why
When a foreground
run_terminal_commandpasses Grok's 15 s auto-background limit, Grok reportsBackgroundTaskStartedwith the tool call id astask_id. T3 registers that id as running background work. The laterget_command_or_subagent_outputTaskOutput names the same id, but hydration only matched a UUID, so the tool row stayed running.hasDeferredBackgroundWorkstayed true at prompt settle, no turn end was written and the thread ran until hung-turns stopped it after 45 min.Evidence (lcr-bench 2026-10-08/09, Grok session logs): 26 of 28 grok arms with call-id background tasks hung; 0 of 13 arms with UUID or no background tasks hung. Example: fe-14222 grok-4.7, task
call-586d8645-9bbb-44f9-a337-ed45d3b87124-70(TaskOutput status failed, exit 2) never matched.Tests
vp test run src/provider/acp/XAiAcpExtension.test.ts: 60 passed. New: the live call-id frames (start + TaskOutput), request-list and task-header forms, must-say-NO ids (call-get-mon,not-a-task, a non-numeric suffix), and a call-id TaskOutput that is still not a subagent.tsc --noEmit(apps/server): clean.vp linton the 2 files: 0 errors (1 pre-existing unused-function warning, line 1716).vp fmt --check: clean.🤖 Generated with Claude Code