You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
t3_background_wait reports its 15-second registration timeout as “Failed to update the awaited background work.” Agents cannot distinguish that timeout from an ordinary provider failure or see that they can retry.
Change
Report registration timeouts separately, with guidance to retry using the same task IDs. Keep the existing deadline, underlying cause and caller interruption behavior.
Scope and approval
Fixes#33646. This is a small, focused correction to error classification and guidance for an existing operation. Provider locking and wait registration behavior stay the same.
Verification
The regression failed on unchanged upstream: expected timed-out, received failed. The fixed service suite passes all 29 tests.
env -u DISPLAY -u WAYLAND_DISPLAY vp run check:changed upstream/main passes, including three affected package typechecks and 31 tests.
A native-clock probe using the real service, in-memory SQLite and synthetic session boundaries reached the actual 15-second deadline. Before: generic failed with TimeoutError. After: timed-out, retry guidance, one adapter invocation and cancellation. Success, ordinary provider failure and caller interruption retained their behavior. The MCP handler passes the service message through unchanged.
Actual loaded-Claude lock contention remains unproven. A real-model retry eval was not run because the eval runner's credentials/proxy were unavailable; no model-level retry success is claimed.
Reviewed with review-loop: 1 round with Claude Opus 5.5 on xhigh. Reviewer verdict: approved.
Created with GPT-6.1 Sol in Codex through T3 Code.
Macroscope's review found this PR approvable — Background-wait registration timeouts now receive a specific message with retry guidance. The existing deadline and underlying registration behavior remain unchanged, limiting exposure to error reporting.
You can add or adjust custom eligibility rules. Learn more.
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
No actionable comments were generated in the recent review.
Walkthrough
Background-task wait timeouts now return a distinct timed-out error with retry guidance. Other runtime failures continue to return failed. Tests cover timeout and runtime-failure outcomes, plus successful, unavailable, and unsupported outcomes.
Changes: Background wait error handling
Layer / File(s)
Summary
Timeout error contract and classification apps/server/src/orchestration-v2/ThreadManagementService.ts
The error reason accepts timed-out and its message reports the 15-second timeout and advises retrying with the same task IDs. awaitBackgroundTasks maps timeout causes to this reason; other failures map to failed.
Tests cover runtime failure and timeout, including advancing the test clock to the 15-second limit. They also cover successful, unavailable, and unsupported outcomes.
Background-wait registration timeouts now return a distinct timed-out error with same-ID retry guidance, and other failures still return failed. The change is narrow and tested, with no concrete merge-blocking risk identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(server): explain background wait registration timeouts" matches the main change. The diff adds a distinct "timed-out" reason to ThreadManagementBackgroundWaitError, and the 15-second re…
Description check
The description follows the template's required sections: Problem, Change, Scope, and Verification. The Problem section explains the generic timeout message and why it hinders agents. The Change secti…
Linked Issues check
[#33646] asks that a registration timeout in t3_background_wait be reported distinctly, so the agent can tell a busy-session timeout from a failure and retry. At head cac3203, ThreadManagementService.…
Out of Scope Changes check
The whole-PR diff from merge base 66cc44d to head cac3203 changes two files. ThreadManagementService.ts adds the Cause import, the "timed-out" reason and message, and the timeout-based reason selectio…
Full details: Title check
Explanation
The title "fix(server): explain background wait registration timeouts" matches the main change. The diff adds a distinct "timed-out" reason to ThreadManagementBackgroundWaitError, and the 15-second registration timeout is now reported separately with same-task-ID retry guidance instead of a generic failure. The title is specific and follows the conventional commit style used in the template.
Full details: Description check
Explanation
The description follows the template's required sections: Problem, Change, Scope, and Verification. The Problem section explains the generic timeout message and why it hinders agents. The Change section states the timed-out classification and retry guidance. Scope links issue #33646 and explains why the change is a bug fix. Verification gives focused test results (29 tests passing, a regression that failed before the fix), a native-clock probe, and the limits of what was checked, including the unproven Claude lock contention and the unrun real-model eval. The template's optional agent attribution line is present. Minor gap: the Scope section does not explicitly state why no issue is needed, but a linked issue exists, so this is not required.
Full details: Linked Issues check
Explanation
[#33646] asks that a registration timeout in t3_background_wait be reported distinctly, so the agent can tell a busy-session timeout from a failure and retry. At head cac3203, ThreadManagementService.ts adds a "timed-out" reason to ThreadManagementBackgroundWaitError. The new message states the 15-second timeout and says to retry with the same task IDs. In awaitBackgroundTasks, reason is set to "timed-out" when Cause.isTimeoutError(cause) holds. All other failures keep "failed" and keep the underlying cause. The 15-second deadline and the lock and registration logic are unchanged. ThreadManagementService.test.ts adds a timed-out case. It blocks the runtime with Effect.never, advances TestClock by 14999 ms, confirms the request is still pending, advances 1 ms, and asserts reason "timed-out" with a TimeoutError cause and one adapter call. It also adds a runtime-failed case that asserts "failed" with the provider error. The issue lists lock changes as optional fixes, so leaving the lock unchanged does not fail this check. Residual uncertainty: the MCP handler's pass-through of the new message is taken from the issue and PR description. It was not re-read in this diff. Real-host lock contention is not reproduced, as the PR states.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff from merge base 66cc44d to head cac3203 changes two files. ThreadManagementService.ts adds the Cause import, the "timed-out" reason and message, and the timeout-based reason selection. ThreadManagementService.test.ts adds the runtime-failed and timed-out cases and their assertions, plus the Cause and Fiber-based flow those cases need. Each change supports the timeout classification and retry guidance for #33646. No unrelated edits appear in the diff. Residual uncertainty: the MCP handler file is not part of this diff, so no change there is in scope or out of scope.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
The automated pipeline stopped on this pull request and will not merge it:
the capture step could not show the problem on the base commit, so there is nothing to prove fixed.
On each commit, ran two completed batches of four concurrent threads. Each thread launched sleep 120 using background Bash, obtained its valid task ID, and repeatedly called t3_background_wait while alternating waiting=false and waiting=true for 12 requested registrations. Inspected persisted raw tool results and the web conversation. The exported transcripts contain 105 completed calls on base and 109 on head, including additional agent calls; none returned a timeout error. One head call returned unmatched after its task finished. An additional batch's launches stalled before producing results.
🤖 claude-opus-5-5 responding on behalf of ZenYoda3
I reported #33646. The capture likely missed it because the timeout needs a heavily loaded host, and four concurrent threads don't get there.
From our own Claude Code transcripts, T3 0.1.9 on macOS (8 cores), Claude provider, about 30 agent threads at once:
25 of about 1,400 t3_background_wait calls between 9 and 13 Nov failed with "Failed to update the awaited background work." The failing calls took a median of about 22 s, past the 15 s registration deadline.
Of the 824 calls our 1-minute load-average log covers (10 to 13 Nov), 12 of 132 (about 9%) failed while load was above 150, and 3 of 692 (under 0.5%) at 150 or below. Median load was about 200 at a failure and 24 at a success.
So a capture that should show it on base is the same script with the host saturated while the waits register: far more concurrent threads, or CPU load well above the core count. We haven't run that capture ourselves, because the machine where we see it runs our agents. The new message in this PR would at least tell agents to retry.
The automated pipeline stopped on this pull request and will not merge it:
the fix is written and reviewed, but proving it needs something no worker has:
Permanent blocker: The reported reproduction requires concurrent live Claude threads with working first-party Claude access, which the VM brief lists as unavailable. A configured OAuth token alone does not establish usable access.
The generic error on base, explicit timeout advice on head, and retrying with the same task IDs remain unverified under the reported host-load conditions.
Preserve the 15-second registration bound and report timeouts with retry guidance while leaving provider failures and interruption unchanged.
Implemented by GPT-6.1 Sol through Codex in T3 Code.
Co-authored-by: GPT-6.1 Sol <[email protected]>
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
size:XS0-9 changed lines (additions + deletions).takeover:blockedTakeover blocked; reason in the PR bodyvouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
3 participants
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.
Problem
t3_background_waitreports its 15-second registration timeout as “Failed to update the awaited background work.” Agents cannot distinguish that timeout from an ordinary provider failure or see that they can retry.Change
Report registration timeouts separately, with guidance to retry using the same task IDs. Keep the existing deadline, underlying cause and caller interruption behavior.
Scope and approval
Fixes #33646. This is a small, focused correction to error classification and guidance for an existing operation. Provider locking and wait registration behavior stay the same.
Verification
timed-out, receivedfailed. The fixed service suite passes all 29 tests.env -u DISPLAY -u WAYLAND_DISPLAY vp run check:changed upstream/mainpasses, including three affected package typechecks and 31 tests.failedwithTimeoutError. After:timed-out, retry guidance, one adapter invocation and cancellation. Success, ordinary provider failure and caller interruption retained their behavior. The MCP handler passes the service message through unchanged.Actual loaded-Claude lock contention remains unproven. A real-model retry eval was not run because the eval runner's credentials/proxy were unavailable; no model-level retry success is claimed.
Reviewed with review-loop: 1 round with Claude Opus 5.5 on xhigh. Reviewer verdict: approved.
Created with GPT-6.1 Sol in Codex through T3 Code.