Repository navigation
fix(server): allow provider handoffs during background work - #110
Conversation
|
Prevent retained outgoing provider snapshots from taking over the active conversation after a handoff or rollback. Require execution advancement or a new recorded handoff before reactivating an existing inactive thread. Capture the incoming provider's prior state before SQL upsert, and apply the same activation rule in the in-memory projection. Preserve roster and timestamp updates and deliberate same-run retry handoffs. Cover late updates, rollback, return switches, and tied retry handoffs. Implemented and reviewed with GPT-6 Astra Pro in ChatGPT.
|
Validated the provider handoff changes in an isolated checkout.
Commit GPT-6.1-Sol through Codex in T3 Code. |
Shipping verdict for PR110: PASS+NOTESExact head. Goal. A user can send to a different provider while the current one still runs background agents or commands. The old work keeps running, and late updates from the old session no longer take the thread's active provider binding back. What changes against main
Executed at the exact head
Source checks
Notes (non-blocking)
Limits
Verdict. PASS+NOTES at Claude Opus 5.5 via Claude Agent in T3 Code. |
Follow-up defect repair
Commit
d120792fe8fixes a lifecycle issue exposed by retaining the outgoing session: a late background update could make the old provider conversation active again after a successful handoff.The SQL and in-memory projections now preserve the selected binding unless an inactive provider thread advances its execution or receives a new recorded handoff. The regression also covers rollback lowering the active run ordinal, deliberate same-run retry handoffs, and switching back to a previous provider. Outgoing task rosters and timestamps continue to update.
SQL captures the incoming provider's prior state before its upsert through indexed joins in the existing lookup. Independent review reproduced the rollback edge in the first fix and verified the final predicate and regression sequence.
Follow-up validation
vp run check:changed.seccomp_unotifysupervisor, so the combined local gate is not fully green; the direct checks above completed.Follow-up audit and fixes: GPT-6 Astra Pro in ChatGPT.
Problem
Sending immediately after changing providers can fail with “The previous provider is still running background agents or commands,” then succeed when sent again later. The immediate-send path rejects an independent handoff that the queued-send path already supports safely.
Change
Keep busy outgoing sessions alive during independent provider handoffs and send the message to the selected provider on the first attempt. Idle sessions still detach. Shared-history account restarts, provider-home changes, and explicit fresh sessions retain their existing background-work guards.
Scope and approval
Focused fix requested for the reported send/retry error, using the existing queued-handoff policy. The shared server path covers web, desktop, mobile, and agent sends without contract or UI changes.
Verification
vp run check:changed: all 87 tests across 5 files pass, along with format, lint, both knip checks, GraphQL validation, and the native addon build.Server replay result:
Model: GPT-6 Astra (xhigh). Harness: Codex in T3 Code.