## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Tasks from a connected chat (for example GitHub pull request reviews) show Retry when a run fails > - A person's Retry on such a task first asks the chat retry owner to repeat the exact failed chat request. #21038 made a refusal at the click continue the task from saved work instead > - The chat owner can also defer its source check (a busy identity, endpoint, or agent row lock) and refuse it a few seconds later. Then the route has already answered 202, and the task Retry receipt was marked failed with no run > - The task stayed blocked, and its execution blocker told the person to send a message, while the interruption projection still offered Retry > - This pull request makes that late refusal take the same board continuation as a refusal at the click, and makes the blocker offer Retry for recovered saved work > - The benefit is that an accepted Retry always starts work, and the two projections agree ## Linked Issues or Issue Description No public issue exists. This is the bug description, in the fields of `.github/ISSUE_TEMPLATE/bug_report.yml`. **What happened?** On a hosted deploy, about 20 blocked tasks of one busy GitHub review agent (`paperclip_runner`, native remote runs) did not restart after Retry. `POST /api/issues/:id/retry` returned 202 with `accepted: true`, a `chatActionId`, and `presentation.state: retry_scheduled`. No run was created. The task Retry receipt changed to `failed` 5 to 10 seconds later, and the task stayed blocked. The activity record of each click (`chat.failed_run_retry_requested`) has `sourceAuthorizationPending: true`, so the chat owner deferred its source check at the click. No chat wake row was written, so the chat replay ended before admission. The last run failed with `native_continuation_requires_reconciliation` / `runner_remote_process_identity_unavailable`. Its saved work was recovered (`workspaceRecovery.status: recovered`, remote lease destroyed with a termination receipt). The projections disagreed: `interruption` had `canRetry: true`, but `executionBlocker` had `canRetry: false` and `nextAction: "Saved work recovered. Send a message to continue."`. Root cause: when the chat retry action settles `failed`, `releaseUnadmittedTaskRetryInput` in `server/src/services/chat-channels/task-retry-input.ts` marked the linked task Retry receipt `failed`. #21038 added a board-continuation fallback only for a refusal inside the click transaction. A refusal after a deferred source check (for example 8 lock-busy attempts on the agent row, about 7 seconds) had no fallback. Separately, `getExecutionBlocker` hid Retry for every chat-bound task (`canRetry && !chatBinding`), and `workspaceRecoveryDisplay` always said "Send a message to continue" for recovered work. **Expected behavior** A Retry that is accepted starts work. If the exact chat replay is refused after the click, the person's Retry continues the task from its recovered saved work. The execution blocker and the interruption both offer Retry, and neither tells the person to send a message to unblock a failed run. **Steps to reproduce** 1. Bind a task to a GitHub chat conversation. Make its latest native run fail with `native_continuation_requires_reconciliation` and recover its saved work. 2. Hold the chat identity advisory lock while you click Retry, so the source check is deferred (`sourceAuthorizationPending: true`). 3. Hold a row lock on the agent while the chat retry processes, so the deferred check fails 8 times. 4. The route returned 202. The chat action settles `failed`, the task Retry receipt changes to `failed`, and no run starts. **Paperclip version or commit** `master` ata8580160(the deployed revision). Reproduced onf30005440b. **Deployment mode** Hosted (cloud) instance with Daytona remote sandboxes and a GitHub chat connection. **Agent adapter(s) involved** `paperclip_runner` (native remote runs). The fix is in core Retry code and is not adapter-specific. ## What Changed - `server/src/services/task-retry.ts`: new `settleRefusedTaskChatRetry`. When a chat retry action settles `failed`, the linked task Retry receipt becomes an ordinary board continuation if all of these are true: it is a person's Retry (or an automatic Retry that the same person's click has joined), its source run is still the latest run and its saved work is recovered (system recovery `complete`, workspace recovery `recovered`), the clicking person still has task access, the chat wake has no run, and no saved or unadmitted chat input remains. Any other refusal still settles the receipt as failed, so the existing source-edited, revoked, and identity-expiry outcomes do not change. A paused agent does not fail the receipt: it stays deferred and starts when dispatch allows. The receipt drops `chatActionId`, stays `deferred_issue_execution`, notifies the deferred-receipt worker, and records `issue.retry_continued_from_saved_work`. Otherwise the receipt is failed as before. `reconcileTaskChatRetryReceipts` uses the same check, so a crash before settlement is also covered. Its failed write matches the chat binding it read, so a stale pass cannot fail a receipt that settlement already converted. - The task Retry intent now records `initiatedBy` for an automatic Retry, so an automatic Retry keeps the exact-replay requirement after the click too. - `server/src/services/chat-channels/task-retry-input.ts`: `releaseUnadmittedTaskRetryInput` calls the task owner's settlement instead of failing the receipt directly. - `server/src/services/execution-blocker.ts` and `workspace-recovery-receipt.ts`: for a failed or timed-out run whose saved work is recovered, the blocker offers Retry also on a chat-bound task. The text follows actual Retry eligibility: "Saved work recovered. Retry continues from it." when Retry is offered, "Saved work recovered." when it is not (for example cleanup quarantine), and "Send a message to continue" only for a stopped run. Only the task blocker decides Retry. The run-level projection (`execution-projection.ts`) has no task context, so it says "Saved work recovered." and never claims Retry. `execution-projection.ts` uses the same text. - `ui/src/lib/activity-format.ts`: labels for the new activity. - `doc/execution-semantics.md`: the late-refusal rule. - Tests: a new real-service case in `server/src/__tests__/chat-channels.integration.test.ts` that reproduces the hosted state (remote saved workspace, destroyed lease receipt, recovered recovery action, deferred source check, refused replay), for a person's Retry and for an automatic Retry. A gate case per continuation condition (unrecovered workspace and revoked access settle failed; a paused agent stays deferred and runs after resume), a stale-reconcile race case, and a joined-click case. Two existing text expectations are updated. ## Verification - Red before the fix: with only the source changes removed, the new test fails on the projection (`canRetry: false`, "Send a message to continue."). With only the Retry settlement removed, it fails with the receipt `status: "failed"` and no run. - Green after the fix: `npx vitest run src/__tests__/chat-channels.integration.test.ts -t "continues an accepted GitHub task Retry from recovered saved work"` passes 2/2. The person's Retry starts one queued run that resumes the preserved workspace, and the automatic Retry still settles as failed. - Focused suites pass: `task-retry`, `execution-projection`, `execution-projection-recovery`, `workspace-recovery-retry-copyback`, `chat-failed-run-retry-boundary`, `workspace-recovery-admission`, `remote-workspace-recovery-receipt-fallback` (372/372), and other recovery, blocker and continuation suites. - `npx tsc --noEmit -p server/tsconfig.json` passes. - Staging was read with GET requests only. No POST was sent. ## Risks - Behavior change: a person's Retry on a connected task that the chat owner refuses after the click now starts a board continuation. It is the same continuation #21038 already uses for a refusal at the click, with the clicking person's authority, and dispatch keeps every normal gate. - Receipts that already failed on staging stay failed. The next click on those tasks takes the fixed path. No migration. - The blocker now reports `canRetry: true` for chat-bound tasks only when the failed run's saved work is verifiably recovered. > 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, with tool use and code execution in Claude Code. ## 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>
@paperclipai/ui
Published static assets for the Paperclip board UI.
What gets published
The npm package contains the production build under dist/. It does not ship the UI source tree or workspace-only dependencies.
Storybook
Storybook config, stories, and fixtures live under ui/storybook/.
pnpm --filter @paperclipai/ui storybook
pnpm --filter @paperclipai/ui build-storybook
Typical use
Install the package, then serve or copy the built files from node_modules/@paperclipai/ui/dist.
Editor dependency identity
Keep the root and workspace overrides for @codemirror/state,
@codemirror/view, and @lezer/common aligned. CodeMirror requires shared
extension identity, while Lezer parsers and syntax highlighters require shared
NodeProp IDs. Multiple Lezer copies can crash code-block highlighting with
tags is not iterable. src/lib/codemirror-single-instance.test.ts checks the
installed dependency graph and highlights sample code through the editor's real
language dependencies. GitHub Actions owns regeneration of pnpm-lock.yaml.