Repository navigation
fix(reactor): never re-answer a parked call that already has a result - #1492
Conversation
The pending-operation removal reaches metadata in a second await after the result turn, so a crash between the two leaves a stale op for a call history already answers. A reactor rebuilt from that store re-armed its gate and, at the original deadline, appended a second tool_result for the same call id, which the prompt tripwire rejects. Startup now drops and persists the removal of any loaded op whose parked call already has a result, and the approval timeout injects no synthetic result for such a call.
TheGreatAxios
left a comment
There was a problem hiding this comment.
Review · Approve
Drops stale pending operations at startup (and persists the removal) plus skips the approval-timeout synthetic result when the parked call already has a result, closing the crash-window double-tool_result.
Findings
No findings.
|
Superseded by CL-10781, which stores a pending approval in turns.jsonl next to the call it parks. Once the call's result is in the log, a rebuilt agent never sees an open approval for it, so neither the start-up drop nor the timeout skip in this PR is needed, and nothing changes under |
Crash recovery could reload a pending operation for a call the turns already answer, re-arming its gate and injecting a second tool result at the deadline. load() now drops any pending operation whose suspended call id already has a tool result, warning per drop; marker operations without a suspended call pass through. The removal converges to disk on the next metadata write.
|
Triage: Pass No changes needed from you. A maintainer will review this pull request. |
ebd3fbe
into
cl-10764-persist-pending-operation-removal-when-an-approved-call-is
Summary
approval timed outresult, and logs that it skipped it.Stacked on #1485; review that first. The diff against its branch is this change only.
Verification
bun run checkandbun run testpass (9203 tests)Malformed tool sequence: duplicate tool_result, and a second result for an answered call) and pass on this branchFixes CL-10765
Part of CL-10763