Skip to content

Preserve completed async results after interrupted responses - #41

Merged
fitchmultz merged 2 commits into
mainfrom
fix/preserve-async-receipts
Sep 23, 2026
Merged

fitchmultz merged 2 commits into
mainfrom
fix/preserve-async-receipts

Conversation

@fitchmultz

@fitchmultz fitchmultz commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Fix

Keep completed tool results in the automatic recovery handoff when the assistant response that started them errors or is interrupted. Native asynchronous tools may already have finished before that response fails. Returning early discarded their results even though Pi still projects them.

The fix removes that early return and uses the existing call/result matching. No new state, policy, or dependencies.

Verification

  • Reproduced with the real fork SDK and scripted native async provider responses; the tool executed once, but its receipt disappeared from the fresh request.
  • Added regression cases for overflow recovery, interruption, and output-length stops. All three fail on the original code.
  • All 27 native tests pass with the fix on the installed fork 0.87.1.
  • Updated the existing truncated-call check to require the projected error receipt to remain explicitly labeled not executed, while still excluding the older batch. This matches Pi's projected result and the existing recovery contract.
  • git diff --check passes.
  • CI checks the pinned fork, types, unit/rendering tests, source integration, and official-host refusal.

@fitchmultz
fitchmultz merged commit de3f436 into main Sep 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant