mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-16 11:59:26 +01:00
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - When a run cannot be resumed, #21135 continues the task in one fresh run from its saved work, with no person action > - In Runner Full-Stack E2E 43321773136, two tasks whose run lost its Runner three times recorded that continuation ("Unfinished run continues in a fresh run from saved work", `delivery: recorded`), but no continuation run started in the next 5 minutes > - The native executor saves its exhaustion hold (`native_session_retry_exhausted`, board-owned) in the same failure path. When that hold lands after the decision, the decision is idempotent per run and returns `already_continued`, so nothing settles the new hold. The hold then blocks the continuation's delivery. > - This pull request settles such later reconciliation holds of the same run into the recorded continuation > - The benefit is that the recorded continuation starts, and the task does not wait on a person for an infrastructure fault ## Linked Issues or Issue Description Refs #21135 **What happened?** Runner Full-Stack E2E 43321773136, cases `recovery.explain-stall` and `recovery.source-action` (OpenCode, native Runner): the server logged the fresh-continuation decision at 22:51:30 and 22:51:55. Then the same run logged "native result could not be marked workspace_failed" and "heartbeat execution failed" (`native_session_retry_exhausted`). No continuation run was created in the following 5 minutes. The ownership pass kept reporting one `execution_reconciliation_hold` in progress. **Expected behavior** One fresh continuation starts from saved work after an infrastructure loss, whatever order the failure path saves its records in. **Steps to reproduce** 1. Record a fresh continuation for a failed native run. 2. Save an active `native_session_retry_exhausted` hold for the same run afterwards. 3. Run the disposition and continuation delivery workers. Before this change, no successor run is created. ## What Changed - `server/src/services/fresh-continuation-fallback.ts`: when a continuation is already recorded for the run, the decision settles the run's other owned reconciliation holds (blocking, not a human gate) into it: resolved, `restored`, system-owned, the person-facing text, `coalescedIntoRecoveryActionId` and the primary's delivery state. A task those holds blocked returns to `todo`. The continuation delivery worker is notified. - `server/src/services/fresh-continuation-fallback.test.ts`: regression test for a late exhaustion hold. ## Verification - RED before the change: `npx vitest run src/services/fresh-continuation-fallback.test.ts -t "exhaustion hold lands after"` failed with `expected [] to have a length of 1 but got +0`. - GREEN after: the full file passes (52/52). `issue-recovery-actions.test.ts` and `execution-control-work.test.ts` also pass (191 tests in the three files). Server `tsc --noEmit` is clean. - The E2E recovery cases in #21210 check the continuation starts and finishes on the next cohort. ## Risks - Low. Only holds of the same run that the fallback already owns (reconciliation causes, blocking, no person gate) are settled, and only after a continuation exists for that run. Human gates and workspace restore holds are untouched. > For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and discuss it in `#dev` before opening the PR. Feature PRs that overlap with planned core work may need to be redirected — check the roadmap first. See `CONTRIBUTING.md`. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), Anthropic, used through Claude Code with tool use and code execution. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>