paperclip/ui/src/pages
Dotta 0f94521017
fix(runner): restore local session and task integrity (#12721)
## Thinking Path

> - Paperclip is the control plane for agents that perform work.
> - Paperclip Runner connects durable provider sessions to individual
task runs through PRP.
> - Provider continuity and per-run authority are different lifetimes.
> - The existing implementation mixed those lifetimes and lost event
metadata between provider frames, runnerd, persistence, API
sanitization, and the task thread.
> - That caused failed continuation, missing progress and Plans,
duplicate replies, hidden failures, and unsafe recovery.
> - This repair gives every heartbeat fresh authority, preserves
qualified provider-session continuity, and restores one lossless
presentation path without changing direct adapters.

## Linked Issues or Issue Description

**What happened?**

A second native heartbeat could reuse tickets, leases, command receipts,
sequence state, and run identity from the first heartbeat. Provider
phase and item identity could be lost before the UI read them. Redaction
could corrupt protocol discriminators while still missing malformed
credential tails. The task thread could fold progress into the final
response, hide failures, or show more than one final answer. Native
Codex also exposed approval modes that do not yet have a durable
approval bridge.

**Expected behavior**

Each heartbeat uses a new PRP authority epoch. Codex and OpenCode
preserve exact qualified provider sessions; ACPX emits an explicit
continuity event when its qualified process-replacement policy is used.
Every accepted provider event is presented, classified as internal, or
surfaced as unsupported. The task page shows chronological progress,
reasoning summaries, activity, Plans, interactions, terminal failures,
and exactly one final reply. Direct adapters retain their existing path.

**Steps to reproduce**

1. Enable the unified experimental Paperclip Runner setting.
2. Create a local native Codex, OpenCode, ACPX Claude, or ACPX Codex
agent.
3. Run response, Plan, structured-question/resume, restart,
cancellation, and failure scenarios.
4. Reload the task while active, waiting, failed, and settled.
5. On the old implementation, observe stale run authority, missing
classifications, incomplete output, or duplicated/folded replies.

**Paperclip version or commit**

The repair is based directly on `master` at
`87d05e194b643810d16d20612115acd01d735d43`.

**Deployment mode**

Local development with the embedded database.

Related work: Refs #12616, #12646, #12666, #12685, and #12700.

## What Changed

- Rotates PRP control-plane, outbox, ticket, lease, command, receipt,
and sequence authority for each heartbeat while carrying forward only a
validated provider-session identity.
- Reads `control-plane-state.json`, validates both durable schemas and
lifecycle values, resumes coherent current runs, archives qualified
settled authority, and quarantines malformed or mismatched scoped state
without moving ambiguous live legacy state.
- Preserves Codex provider phase and stable item identities so
commentary remains progress and only `final_answer` becomes final.
- Adds raw OpenCode HTTP/SSE boundary coverage and canonical reasoning
lifecycle mapping.
- Makes ACPX normalization lossless for visible reasoning, tool
lifecycle metadata, stable bounded identities, Plan revisions,
structured requests, failures, and qualified process replacement. Only
the compatible terminal assistant message is promoted as final.
- Applies schema-aware redaction before generic JWT-shaped detection and
scans every diagnostic string leaf. Malformed raw/escaped quoted
credential tails are redacted in both server and durable Rust state.
- Restores snapshot-style chronological task presentation, expandable
tool activity, inline Plan cards, visible waiting/resume/cancel/failure
states, and exactly one final answer.
- Makes `never` the only qualified native Codex permission mode and
rejects unsupported persisted native modes with remediation. OpenCode
and ACPX policies remain intact.
- Keeps the unified experimental Runner setting as the only enablement
flag. Onboarding and direct Codex, Claude, and OpenCode stay on their
legacy execution/finalization paths.
- Adds cross-language goldens, authority/recovery/fault coverage, exact
response/count assertions, and native plus legacy acceptance scenarios.

## Verification

- Pull-request GitHub Actions run Rust formatting/tests, TypeScript
checks, server/UI tests, builds, protocol drift checks, browser E2E, and
security scans.
- A separate workflow-only validation ref is pinned directly on this PR
head and runs the 35-cell paid local matrix: three core scenarios plus
structured-question resume and restart/resume for native Codex, native
OpenCode, ACPX Claude, ACPX Codex, and direct Codex/Claude/OpenCode.
Run: https://github.com/paperclipai/paperclip/actions/runs/33682434315
- Acceptance requires exact single visible replies, monotonic sequences,
matching envelope discriminators, one semantic terminal, one run
terminal, no unresolved interaction, no duplicate mutation, no secret
leakage, provider continuity, and zero native rows for direct adapters.
- Per maintainer direction, tests are running in GitHub Actions rather
than on the slower local host. Only formatters and static diff checks
were run locally.

## Risks

- Recovery from old or partial filesystem state is sensitive. The repair
fails closed, preserves active or unverifiable authority, and
quarantines only state whose scoped ownership is safe to move.
- Provider event formats can change. Closed validators and boundary
goldens turn new or malformed events into visible diagnostics instead of
silent drops.
- Shared task presentation could affect direct adapters. Runtime-fact
gating plus the direct-adapter matrix protect the existing path.
- Managed and remote providers are not qualified here. Shared code
continues to compile and fail safely, but live qualification is
deferred.

> 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

OpenAI Codex based on GPT-5. The exact deployed snapshot and
context-window size are not exposed to this task. It used agentic
reasoning, repository inspection, code editing, Git, parallel subagents,
and GitHub Actions.

## 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 and contains no internal
Paperclip ticket id
- [ ] I have run tests locally and they pass (intentionally deferred to
GitHub Actions)
- [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 risks above
- [ ] All Paperclip CI gates are green
- [ ] The paid local-provider matrix is 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
2026-09-02 16:11:26 -05:00
..
StatusCards test(ui): make the suite independent of the machine timezone (#11478) 2026-08-16 22:22:45 -07:00
agent-skills feat(runner): add administration and observability (#12641) 2026-09-01 03:41:23 -05:00
apps Simplify app connections and enable managed Google access (#12728) 2026-09-02 14:05:53 -05:00
audit copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
secrets copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
skills copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
tools feat(apps): consolidate connector management (#12684) 2026-09-01 14:55:35 -05:00
AdapterManager.tsx Remove cheap model profiles (#12683) 2026-09-01 14:57:38 -05:00
AgentDetail.instructions.test.tsx Remove cheap model profiles (#12683) 2026-09-01 14:57:38 -05:00
AgentDetail.liveRun.test.ts feat(ui): live run label → run detail, running row → task detail (#11034) 2026-08-06 23:18:32 -07:00
AgentDetail.progress.test.ts fix(ui): move agent secret access to searchable secrets tab (#11283) 2026-08-14 08:03:20 -04:00
AgentDetail.tsx feat(runner): add administration and observability (#12641) 2026-09-01 03:41:23 -05:00
AgentToolsTab.test.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
AgentToolsTab.tsx feat(apps): consolidate connector management (#12684) 2026-09-01 14:55:35 -05:00
Agents.test.tsx Clean up experimental settings features (#12681) 2026-09-01 14:23:05 -05:00
Agents.tsx feat(runner): add administration and observability (#12641) 2026-09-01 03:41:23 -05:00
ApprovalDetail.tsx feat(ui): single-source design tokens, visual regression suite, and theme retune (#9134) 2026-07-07 16:22:16 -05:00
Approvals.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
Artifacts.test.tsx PAP-10440: group artifacts by task stacks (#7654) 2026-06-06 10:22:47 -05:00
Artifacts.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
Auth.test.tsx fix(ui): show source SHA for unreleased builds (#9508) 2026-07-13 20:55:54 -05:00
Auth.tsx Brand lockup, no idle env-check card, no Mission row (#12074) 2026-08-24 01:35:15 -07:00
BoardChat.test.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
BoardChat.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
BoardClaim.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
BootstrapSetupUxLab.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
CaseDetail.test.tsx Cases: experimental first-class case object (#9198) 2026-07-09 22:11:03 -05:00
CaseDetail.tsx Cases: experimental first-class case object (#9198) 2026-07-09 22:11:03 -05:00
Cases.test.tsx Cases: experimental first-class case object (#9198) 2026-07-09 22:11:03 -05:00
Cases.tsx Exclude archived projects from the default project list route (#10146) 2026-07-24 07:19:58 -07:00
CliAuth.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
Companies.test.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
Companies.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
CompanyAccess.test.tsx Move company invites into a tab of the Members page (#12289) 2026-08-27 11:34:32 -07:00
CompanyAccess.tsx Move company invites into a tab of the Members page (#12289) 2026-08-27 11:34:32 -07:00
CompanyEnvironments.test.tsx feat: environment delete with agent reassignment and consented sandbox destroy (#12053) 2026-08-23 16:53:17 -07:00
CompanyEnvironments.tsx Hide host-path and execution-engine surfaces in managed-sandbox-only mode (#12293) 2026-08-27 11:59:14 -07:00
CompanyExport.test.tsx refactor(settings): unify settings and speed up exports (#11789) 2026-08-20 12:15:16 -05:00
CompanyExport.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
CompanyImport.test.tsx Gate Paperclip Runner setup behind an experimental flag (#12656) 2026-09-01 05:57:40 -05:00
CompanyImport.tsx Gate Paperclip Runner setup behind an experimental flag (#12656) 2026-09-01 05:57:40 -05:00
CompanySettings.test.tsx Remove the company brand color and per-company attachment limit (#12291) 2026-08-27 12:11:05 -07:00
CompanySettings.tsx Remove the company brand color and per-company attachment limit (#12291) 2026-08-27 12:11:05 -07:00
CompanySettingsPluginPage.test.tsx [codex] Add agent permissions and controls plan (#6386) 2026-05-22 08:12:52 -05:00
CompanySettingsPluginPage.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
CompanySettingsRenameHint.test.tsx feat(server): derive hosted-tenant issue prefixes from the company name and follow renames (#12292) 2026-08-27 11:34:42 -07:00
CompanySkills.test.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
CompanySkills.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
Costs.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
CrossIssueCollaborationUxLab.tsx feat(issues): explain cross-task agent writes with attribution, audit receipts, and actionable denials (#10843) 2026-08-04 23:02:51 -05:00
Dashboard.test.ts feat(ui): dashboard banner for paused imported agents with Resume all (#12142) 2026-08-25 14:09:54 -07:00
Dashboard.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
DashboardLive.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
DecisionQueuePage.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
DesignGuide.tsx feat(apps): add connection intent setup experience (#12347) 2026-08-29 12:08:35 -05:00
ExecutionWorkspaceDetail.provision-status.test.ts fix(workspaces): keep deferred seed databases reliable (#11706) 2026-08-19 10:41:29 -05:00
ExecutionWorkspaceDetail.service-ports.test.ts fix(workspaces): persist readiness state and validate ports (#9408) 2026-07-11 03:02:21 -05:00
ExecutionWorkspaceDetail.test.tsx fix: isolate execution workspace summaries (#10790) 2026-08-11 08:56:32 -04:00
ExecutionWorkspaceDetail.tsx Hide host-path and execution-engine surfaces in managed-sandbox-only mode (#12293) 2026-08-27 11:59:14 -07:00
GoalDetail.test.tsx fix goal view properties toggle 2026-03-30 12:49:22 +05:30
GoalDetail.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
Goals.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
Inbox.test.tsx fix(ui): keep Archive available on every inbox item (#11636) 2026-08-18 15:06:24 -05:00
Inbox.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
InstanceAccess.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
InstanceExperimentalSettings.test.tsx Simplify app connections and enable managed Google access (#12728) 2026-09-02 14:05:53 -05:00
InstanceExperimentalSettings.tsx Simplify app connections and enable managed Google access (#12728) 2026-09-02 14:05:53 -05:00
InstanceGeneralSettings.test.tsx feat: operator-configurable settings visibility via PAPERCLIP_HIDDEN_SETTINGS (#11823) 2026-08-20 17:54:44 -07:00
InstanceGeneralSettings.tsx feat: operator-configurable settings visibility via PAPERCLIP_HIDDEN_SETTINGS (#11823) 2026-08-20 17:54:44 -07:00
InviteLanding.test.tsx Gate Paperclip Runner setup behind an experimental flag (#12656) 2026-09-01 05:57:40 -05:00
InviteLanding.tsx Gate Paperclip Runner setup behind an experimental flag (#12656) 2026-09-01 05:57:40 -05:00
InviteUxLab.test.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
InviteUxLab.tsx Remove the company brand color and per-company attachment limit (#12291) 2026-08-27 12:11:05 -07:00
IssueChatLongThreadPerf.tsx feat(ui): single-source design tokens, visual regression suite, and theme retune (#9134) 2026-07-07 16:22:16 -05:00
IssueChatUxLab.tsx feat(ui): design-system component convergence — Card/Badge adoption, multiplicative radius ladder, unified list surfaces (#9240) 2026-07-08 17:15:45 -07:00
IssueDetail.test.tsx feat(ui): complete the task workspace (#12640) 2026-09-01 02:44:19 -05:00
IssueDetail.tsx fix(runner): restore local session and task integrity (#12721) 2026-09-02 16:11:26 -05:00
Issues.test.tsx Fix request storm polling and issue-list coalescing (#9190) 2026-07-09 17:38:34 -05:00
Issues.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
JoinRequestQueue.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
MyIssues.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
NewAgent.test.tsx Remove cheap model profiles (#12683) 2026-09-01 14:57:38 -05:00
NewAgent.tsx Gate Paperclip Runner setup behind an experimental flag (#12656) 2026-09-01 05:57:40 -05:00
NotFound.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
Org.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
OrgChart.test.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
OrgChart.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
PipelineSettings.test.ts [codex] Add pipeline automation title templates (#8787) 2026-06-30 07:52:40 -07:00
PipelineSettings.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
Pipelines.test.tsx Add pipeline workflow primitives and operator UI (#7903) 2026-06-26 12:02:44 -05:00
Pipelines.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
PluginManager.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
PluginPage.test.tsx [codex] Move instance settings under company settings (#7680) 2026-06-07 17:23:53 -05:00
PluginPage.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
PluginSettings.test.tsx Hide host-path and execution-engine surfaces in managed-sandbox-only mode (#12293) 2026-08-27 11:59:14 -07:00
PluginSettings.tsx Hide host-path and execution-engine surfaces in managed-sandbox-only mode (#12293) 2026-08-27 11:59:14 -07:00
ProfileSettings.test.tsx fix(assets): accept identity-provider characters in image upload namespaces (#12288) 2026-08-27 11:27:31 -07:00
ProfileSettings.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
ProjectDetail.test.tsx fix: preserve plugin detail-tab deep links and bridge the real JSX runtime (#11826) 2026-08-20 23:22:49 -07:00
ProjectDetail.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
ProjectWorkspaceDetail.test.tsx Hide host-path and execution-engine surfaces in managed-sandbox-only mode (#12293) 2026-08-27 11:59:14 -07:00
ProjectWorkspaceDetail.tsx Hide host-path and execution-engine surfaces in managed-sandbox-only mode (#12293) 2026-08-27 11:59:14 -07:00
Projects.test.tsx Information Architecture + project/agent visual refresh (experimental) (#7543) 2026-06-06 09:17:27 -05:00
Projects.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
ResponsibleUserDenialUxLab.tsx feat(ui): design-system component convergence — Card/Badge adoption, multiplicative radius ladder, unified list surfaces (#9240) 2026-07-08 17:15:45 -07:00
RoutineDetail.test.tsx Exclude archived projects from the default project list route (#10146) 2026-07-24 07:19:58 -07:00
RoutineDetail.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
Routines.test.tsx fix(server): add explicit review verdict policies (#10931) 2026-08-05 23:12:41 -05:00
Routines.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
RunTranscriptUxLab.tsx feat(ui): design-system component convergence — Card/Badge adoption, multiplicative radius ladder, unified list surfaces (#9240) 2026-07-08 17:15:45 -07:00
Search.test.tsx feat(search): filters, sorting, operators & command-palette parity (#9327) 2026-07-09 19:32:58 -05:00
Search.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
Secrets.render.test.tsx Let operators hide the Provider vaults and Proposals tabs (#12284) 2026-08-27 11:28:15 -07:00
Secrets.test.ts feat(secrets): add user-specific runtime secrets (#8825) 2026-07-05 05:58:20 -05:00
Secrets.tsx Let operators hide the Provider vaults and Proposals tabs (#12284) 2026-08-27 11:28:15 -07:00
SkillStudio.test.tsx test(ui): wait for conditions in the last four fixed-turn loops (#11523) 2026-08-17 00:58:16 -07:00
SkillStudio.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
SystemNoticeUxLab.tsx fix(recovery): stop automatic stranded-task takeovers (#11961) 2026-08-22 11:41:24 -05:00
TaskChatLab.tsx feat(ui): refine the chat-style task workflow (#11263) 2026-08-12 11:41:40 -07:00
TeamCard.test.tsx [codex] Add teams catalog extraction (#7550) 2026-06-05 12:55:49 -05:00
TeamCatalog.fixtures.ts [codex] Add teams catalog extraction (#7550) 2026-06-05 12:55:49 -05:00
TeamCatalog.test.tsx Gate Paperclip Runner setup behind an experimental flag (#12656) 2026-09-01 05:57:40 -05:00
TeamCatalog.tsx Gate Paperclip Runner setup behind an experimental flag (#12656) 2026-09-01 05:57:40 -05:00
Timeline.test.tsx fix(ui): load the full selected timeline window (#9576) 2026-07-30 21:40:57 -07:00
Timeline.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
UserProfile.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
WhatNeedsMe.test.tsx feat(decisions): add first-class propose mode (#10010) 2026-07-31 19:17:02 -07:00
WhatNeedsMe.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
Workspaces.test.tsx feat: add built-in summarizer and summary slots (#9713) 2026-07-17 11:03:07 -05:00
Workspaces.tsx feat: add built-in summarizer and summary slots (#9713) 2026-07-17 11:03:07 -05:00
useInstallTeamCatalogEntry.test.tsx [codex] Add teams catalog extraction (#7550) 2026-06-05 12:55:49 -05:00