Skip to content

fix(fork): a provider crash wakes the agent once, through upstream's continuation - #63

Open
tebiggs wants to merge 1 commit into
mainfrom
dedup/background-work-crash-wake
Open

tebiggs wants to merge 1 commit into
mainfrom
dedup/background-work-crash-wake

Conversation

@tebiggs

@tebiggs tebiggs commented Nov 21, 2026

Copy link
Copy Markdown
Owner

After upstream pingdotgg#40170, a provider crash with background work the agent waited on woke the agent twice: once through upstream's provider-exit continuation and once through fork #14's own continuation offer in ProviderSessionManager.writeReleasedRosterEvents.

The fork's release path now offers its wake only after an idle timeout, which upstream doesn't cover. After a crash, upstream's continuation is the only wake. The fork still records the lost work on the run for every release it handled before; upstream merges its own entries into that note without duplicates. The Claude query-exit wake in ClaudeAdapterV2.finalizeActiveTurnAfterQueryExit stays, because a Claude query process exiting doesn't release the provider session, so upstream's path never runs for it. FORK.md's #14 line notes the handoff.

Two crash cases no longer wake the agent, accepted as upstream's intended guards:

  • With continueThreadsAfterServerUpdate turned off (it defaults to on), a crash records the lost work but sends no follow-up.
  • After three crash wakes on the same run chain within 5 minutes, a fourth crash records the work without waking, which stops crash loops.

The release-wake test now covers idle (fork wakes), crash (fork doesn't offer; upstream's continuation is queued) and settle (no wake). The crash case fails on main. ProviderSessionManager.test.ts (77 tests) and the server typecheck pass. GPT Sol reviewed it and raised only the two cases above.

Done by Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

…continuation

Upstream's provider-exit continuation (pingdotgg#40170) now wakes the
agent after a provider crash, so the fork's release path wakes it only after
an idle timeout. The fork still records the lost work for every release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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