paperclip/packages/shared/src
Dotta 454edfe81e
Add recovery handoff system notices (#5289)
## Thinking Path

> - Paperclip orchestrates AI agents for zero-human companies.
> - Agent runs can end productively while the source issue still lacks a
durable final disposition.
> - That leaves the control plane unsure whether to resume, escalate, or
close the work.
> - Issue comments also need a presentation contract so system-authored
recovery notices can render as first-class thread messages without
overloading normal comments.
> - This pull request adds successful-run handoff recovery, comment
presentation metadata, and system notice rendering.
> - The benefit is stricter task liveness with clearer operator-facing
recovery state.

## What Changed

- Added successful-run handoff decisions, wake payloads, escalation
behavior, and recovery tests.
- Added issue comment presentation metadata with migration
`0078_white_darwin.sql` and shared/server/company portability support.
- Rendered recovery/system notices in issue chat with dedicated UI
components, fixtures, tests, and storybook/lab coverage.
- Included the current recovery model-profile hint patch so automatic
recovery follow-ups use the cheap profile.

## Verification

- `pnpm install --frozen-lockfile`
- `pnpm exec vitest run
server/src/services/recovery/successful-run-handoff.test.ts
ui/src/components/SystemNotice.test.tsx
ui/src/lib/system-notice-comment.test.ts
ui/src/components/IssueChatThreadSystemNotice.test.tsx`

## Risks

- Migration-bearing PR: merge this before any other branch that might
later add a migration.
- The branch touches both recovery services and issue-thread rendering,
so review should pay attention to recovery wake idempotency and comment
metadata compatibility.

## Model Used

- OpenAI GPT-5 Codex via Paperclip `codex_local` adapter, with
shell/git/GitHub CLI tool use.

## 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 run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] If this change affects the UI, I have included before/after
screenshots
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-05-06 06:05:58 -05:00
..
telemetry [codex] Harden execution reliability and heartbeat tooling (#3679) 2026-04-14 13:34:52 -05:00
types Add recovery handoff system notices (#5289) 2026-05-06 06:05:58 -05:00
validators Add recovery handoff system notices (#5289) 2026-05-06 06:05:58 -05:00
adapter-type.ts feat(adapters): external adapter plugin system with dynamic UI parser 2026-04-03 21:11:20 +01:00
adapter-types.test.ts [codex] Split backend control-plane QoL slice (#4700) 2026-04-28 16:46:45 -05:00
agent-url-key.ts feat: company portability — export/import companies and agents 2026-03-02 09:06:58 -06:00
api.ts [codex] Add issue subtree pause, cancel, and restore controls (#4332) 2026-04-23 14:51:46 -05:00
config-schema.ts Introduce bind presets for deployment setup 2026-04-11 07:09:07 -05:00
constants.ts Add recovery handoff system notices (#5289) 2026-05-06 06:05:58 -05:00
environment-support.test.ts Add sandbox environment support (#4415) 2026-04-24 12:15:53 -07:00
environment-support.ts Add ACPX local adapter runtime (#4893) 2026-04-30 19:57:05 -05:00
execution-workspace-guards.ts Guard closed isolated workspaces on issues 2026-04-04 17:48:54 -05:00
index.ts Add recovery handoff system notices (#5289) 2026-05-06 06:05:58 -05:00
issue-references.test.ts Fix Cloud tenant issue identifier routes (#5196) 2026-05-04 13:20:58 -05:00
issue-references.ts Fix Cloud tenant issue identifier routes (#5196) 2026-05-04 13:20:58 -05:00
issue-thread-interactions.test.ts [codex] Add structured issue-thread interactions (#4244) 2026-04-21 20:15:11 -05:00
network-bind.ts Introduce bind presets for deployment setup 2026-04-11 07:09:07 -05:00
project-mentions.test.ts feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
project-mentions.ts feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
project-url-key.ts fix: append short UUID suffix to project slugs when non-ASCII characters are stripped to prevent slug collisions 2026-03-31 16:35:30 +00:00
routine-variables.test.ts [codex] Split backend control-plane QoL slice (#4700) 2026-04-28 16:46:45 -05:00
routine-variables.ts [codex] Split backend control-plane QoL slice (#4700) 2026-04-28 16:46:45 -05:00
workspace-commands.test.ts [codex] Improve workspace navigation and runtime UI (#4089) 2026-04-20 06:14:32 -05:00
workspace-commands.ts [codex] Improve workspace navigation and runtime UI (#4089) 2026-04-20 06:14:32 -05:00