Repository navigation
Conversation
syanga
left a comment
There was a problem hiding this comment.
[gpt-6-astra] on behalf of Alan
Reviewed 538393a against 0b0a61a. Converged with no remaining findings.
Standards
Fresh native review found no documented-standard breaches or actionable smells. Existing domain helper reused; tests extend observable behavior.
Spec
Fresh native review found no missing requirements or scope creep. All owed wakes include unawaited notices; no new state/replay; query replacement preserved. Explicit audit of legacy assertions confirmed pending ownership and retained consumption, retirement, reset and Stop release controls.
Correctness
Outside Claude Opus 5.5 review found no defects and recommended shipping. Inspected ownership/helper, tombstones, consumption, retirement, reset/Stop, replacement and ProviderSessionManager idle release. Accepted unconsumed-notice retention remains bounded by existing session-manager policy. No tests run by reviewer; fiber timing and every rememberProviderThread caller were not exhaustively traced.
Original reviewed candidate a2097937d3eda18996fbda13ca1c1e6149d8e0b8 was rebased onto upstream test refactoring. A fresh native focused review confirmed identical ordered patch changes after whitespace normalization, byte-identical production code, preserved fixture messages/release controls, and unchanged lifetime caller. Earlier reviews remain applicable to this head.
Required vp run check:changed passed: 409 tests, format/lint/Knip/GraphQL/three typechecks. No live Claude cancellation/provenance claims; astack #165 remains open.
Remaining findings: Standards 0; Spec 0; Correctness 0.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Claude sessions now remain alive while already-owed wake turns are pending, preventing idle cleanup from discarding that work. The change is confined to existing session lifecycle tracking and introduces no new product defaults or permissions. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
syanga
left a comment
There was a problem hiding this comment.
[gpt-6-astra] on behalf of Alan
Reviewed integration head 9803b37 against its upstream parent 5dd8cde. This supplements the prior signed review on 538393a.
Standards
Prior standards conclusions remain applicable: the production and test patch is equivalent after line shifts. No new findings.
Spec
A fresh independent native verifier confirmed all-owed ownership including unawaited tasks, shared published pendingBackgroundWork semantics, no new state or replay, preserved query-replacement predicate, and meaningful release assertions for consumption, retirement, reset and Stop. No findings.
Correctness
Focused independent integration verification inspected pinned new source, both patches, changed upstream lifecycle code, runtime contracts and callers. Ownership cleanup remains compatible; ProviderSessionManager retains the session probe and existing idle-pin cap. Its new release-time cleanup does not bypass the probe. Prior outside Claude correctness conclusions remain applicable to the fix, supplemented by this verification. No findings.
Verification: new-head CI passed lint, build/typecheck, test and all eight server shards; Macroscope approved this head. No local tests rerun and no code edited. Prior local409 tests/check:changed evidence applies to the original patch; current integration execution is evidenced by CI.
Limits: this is focused integration verification, not a full review of unrelated upstream changes. No live Claude cancellation, dispatch acknowledgment or resumed-context normalization verified. astack #165 remains open.
Remaining findings: Standards0; Spec0; Correctness0.
syanga
left a comment
There was a problem hiding this comment.
[gpt-6-astra] on behalf of Alan
Reviewed integration head 5cc2e2a against upstream parent 4860a73, supplementing prior review of 9803b37.
Standards
Prior review remains applicable: the patch is identical apart from line offsets and blob IDs. No findings.
Spec
Fresh independent native verification confirms all existing owed wakes, including unawaited tasks, retain lifetime. No new state or replay; query replacement retains its separate guard. Consumption, retirement, reset and Stop retain observable release assertions. No findings.
Correctness
The verifier inspected the pinned patches, ownership cleanup and runtime callers. Upstream missing-conversation recovery and cooldown changes remain compatible. Prior outside correctness coverage remains applicable to the unchanged fix. No findings.
Verification: GitHub CI on this exact head passed lint, build/typecheck, Test, all eight server shards and aggregate Check. No local tests rerun or source edits. This focused integration check does not review all unrelated upstream changes or verify live Claude cancellation, exposure or resumed context. astack #165 remains open.
Remaining findings: Standards 0; Spec 0; Correctness 0.
|
Hit this today on v0.1.9 (macOS desktop, Claude Code 2.1.325, opus-5-5), with provider logs, in case another real-world case helps since #33041 and #37252 were both closed as non-repro. Setup: the agent started a background Bash command, awaited it with From the provider event log: So the wake turn was already requesting when T3 closed the CLI. T3 then started a continuation run (ordinal 14, the "Command ... finished" notice in the timeline). It opened a resumed query, never sent anything, and finalized about 1.4 s later with One more thing in the server trace: Happy to share more of the log if it helps. |
|
Note Written by Claude Opus 5.5 on behalf of @BartWaardenburg Thanks for this fix. It covers 26 of the 28 lost wakes in my logs (data in #33041), so please merge it soon. A follow-up idea: some close paths still drop a wake (the 4-hour pin expiry, a model switch, a crash). The Codex adapter does not have this problem, because T3 itself starts the wake run from the completion event. Claude could do the same: T3 records the owed wake and turns it into a continuation run on any close. Then correctness no longer depends on the timing of the close. Details for an implementer (code paths, proposal, test)Close paths that still drop a wake on
|
Problem
When a background command ends while a Claude thread is idle, Claude Code sends
task_notificationand then starts its own turn to handle it. T3 can close the Claude process before that turn sends its first frame. The agent never sees the result, and the thread stays idle until the next user message. The resumed Claude transcript then shows a<synthetic>"No response requested." entry right after the<task-notification>.In that gap,
hasPendingBackgroundWorkinClaudeAdapterV2.tsreturns false. The task has left the roster, and the wake turn has not started. A session release that checks the probe in the gap closes the process.Change
hasPendingBackgroundWorknow returns true while any remembered native thread has an owed wake task. It reads the existingowedWakeTasksForNativeThread, so it adds no state and no replay. It covers awaited and unawaited notices.The session still releases after the wake turn consumes the notice, after a continuation run retires it, on a process reset, and on Stop. If a notice is never consumed, the session stays open until one of those happens or the 4-hour idle pin limit (
DEFAULT_MAX_IDLE_PIN_MS) runs out. Query replacement keeps its own check.Scope
Bug fix. #33041 and #37252 report this bug. Both were closed because the maintainer could not reproduce it. Later comments on #33041 and on this PR add provider logs from v0.1.9 that show the same sequence.
This PR does not fix a wake that is lost when the Claude process exits (#30156) or when auto-settle detaches the session after a PR merge (#26083).
Verification
I found the bug when my Claude agents went silent after a background command ended. Each resumed transcript had the "No response requested." entry right after the notice.
ClaudeAdapterV2.test.tsfailed because the probe returned false after the notification. The cases include both orders of the empty roster and the notice, and a sibling task. After the fix,vp run check:changedpassed 409 tests, and format, lint, Knip, GraphQL, and three typechecks passed. CI passes on the current head.query.close71 ms aftertask_notification. BartWaardenburg logged 28 lost wakes in 10 days (Claude session closed right after a background job ends, so the wake turn never runs #33041) and reports that this change covers 26 of them.Implemented with GPT-6 Astra through Codex in T3 Code. Correctness reviewed with Claude Opus 5.5.