[Fix] Sessions show false interruptions and lose resumable task errors - #2405
[Fix] Sessions show false interruptions and lose resumable task errors#2405roomote-roomote[bot] wants to merge 2 commits into
Conversation
|
Fixed the cross-turn recovery-budget finding in 8e816e69 and resolved the review thread.
PR metadata is refreshed and the PR remains draft. Browser proof is not applicable to this backend enforcement change. Automatic re-review is underway; this reports the pushed fix and local verification, not a completed fresh review or a fix for provider availability. |
| } | ||
| const args = parsed.data; | ||
| if ( | ||
| args.continuation === 'instruction' && |
There was a problem hiding this comment.
taskMessageInstructionId is set for every substantive human turn, including a status check. Because continuation is supplied by the model, a later “Any update?” turn can send continuation: "instruction"; this condition accepts it, acceptInstruction clears the persisted recovery reservation, and the next task-settled event can recover the same work again. That still breaks the one-recovery-per-outstanding-request limit. Derive the reset boundary from an actual new directive server-side rather than trusting the model-selected mode on any human message.
What changed
Why this change was made
Successful silent recovery could leave a marker that reconciliation later mislabeled as an interruption. Separately, idle settlement could hide an error from the parent, making accurate status and recovery decisions harder. These corrections address reporting and orchestration behavior, not the underlying provider failure.
Impact
Sessions avoid false interruption notices after successful recovery and retain meaningful error context for resumable work. The recovery budget is now enforced from persisted receipts rather than prompt text alone. Repeated task-settled events, new run IDs, and local guard resets do not grant another recovery. Explicit human instruction intent remains distinct from status checks; platform and reaction events cannot select instruction mode without an intervening human directive. No schema migration or retry scheduler is introduced. Generic provider errors are not assumed transient, and prior progress claims do not override current execution/error evidence.
Focused validation passed: 439 tests across Fast service, recovery guard, prompt, native tool bridge, and conversation repository, including real-database receipt-history coverage and a seven-turn recovery regression. The earlier idle-notification correction passed 19 targeted tests. Package TypeScript and full pre-push lint, fast typecheck, and knip gates passed. Browser proof is not applicable to these server lifecycle/payload and prompt changes. The original provider incident was not reproduced end-to-end, and this PR does not establish its root cause or fix provider availability.