paperclip/ui/src/components
Dotta 15eac43b43
[codex] Retry max-turn exhausted heartbeats (#5096)
## Thinking Path

> - Paperclip orchestrates AI agents for autonomous companies, and
heartbeat execution is the control-plane loop that keeps assigned work
moving.
> - Max-turn exhaustion is a recoverable local-adapter stop condition
for Claude and Gemini agents when a run needs another heartbeat to
continue safely.
> - The previous behavior could leave max-turn continuation details hard
to inspect, and duplicate/stale continuation wakes could keep running
after issue state changed.
> - The adapter layer also needed to avoid trusting arbitrary
stdout/stderr text as scheduler control metadata.
> - This pull request adds bounded max-turn continuation scheduling,
visible retry state, structured stop metadata handling, and
stale/duplicate continuation guards.
> - The benefit is safer automatic continuation after max-turn stops,
clearer operator visibility, and fewer duplicate or stale agent runs.

## What Changed

- Replaces closed PR #4952, whose head repository was deleted.
- Rebases the recovered max-turn continuation branch onto current
`paperclipai/paperclip:master`.
- Adds max-turn continuation scheduling and retry-state plumbing for
heartbeat runs.
- Adds stale/duplicate continuation suppression when issue status,
ownership, or execution locks change.
- Normalizes Claude/Gemini max-turn detection around structured stop
metadata instead of unstructured stdout/stderr text.
- Surfaces max-turn continuation settings and retry visibility in the
board UI.
- Adds focused server, adapter, and UI tests for max-turn stop metadata,
retry scheduling, stale queued-run invalidation, adapter
parsing/execution, run ledger display, and agent config patching.

## Verification

- `pnpm install --no-frozen-lockfile` to refresh local dependencies
after rebasing onto current `master`.
- `pnpm run preflight:workspace-links && pnpm exec vitest run
server/src/__tests__/claude-local-adapter.test.ts
server/src/__tests__/claude-local-execute.test.ts
server/src/__tests__/gemini-local-adapter.test.ts
server/src/__tests__/gemini-local-execute.test.ts
server/src/__tests__/heartbeat-retry-scheduling.test.ts
server/src/__tests__/heartbeat-stale-queue-invalidation.test.ts
server/src/services/heartbeat-stop-metadata.test.ts
ui/src/components/IssueRunLedger.test.tsx
ui/src/lib/agent-config-patch.test.ts ui/src/lib/runRetryState.test.ts
--testTimeout=20000`
- `pnpm --filter @paperclipai/adapter-claude-local typecheck && pnpm
--filter @paperclipai/adapter-gemini-local typecheck && pnpm --filter
@paperclipai/server typecheck && pnpm --filter @paperclipai/ui
typecheck`
- UI screenshot note: the UI changes are limited to config/ledger state
rendering rather than layout changes; component/unit coverage above
verifies the rendered behavior.

## Risks

- Medium behavior risk: heartbeat retry gating now suppresses max-turn
continuations when issue state or execution locks drift, so any callers
that relied on stale continuations running will now see cancellation
instead.
- Low adapter risk: Claude/Gemini unstructured text no longer triggers
max-turn scheduler metadata, so only structured stop signals and Gemini
exit code 53 are trusted.
- No database migrations.

> 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 coding agent, GPT-5-class model, tool-enabled local
repository editing and command 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 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 (not applicable: state/default rendering only; covered by
component/unit tests)
- [x] I have updated relevant documentation to reflect my changes (not
applicable: no user-facing command or docs contract changed)
- [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-03 11:30:48 -05:00
..
access Add dedicated environment settings page and test-in-environment (#4798) 2026-04-29 15:56:13 -07:00
transcript [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
ui [codex] Polish issue board workflows (#4224) 2026-04-21 12:25:34 -05:00
AccountingModelCard.tsx feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
ActiveAgentsPanel.test.tsx [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
ActiveAgentsPanel.tsx [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
ActivityCharts.test.tsx [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
ActivityCharts.tsx [codex] Harden dashboard run activity charts (#4126) 2026-04-20 10:34:21 -05:00
ActivityRow.tsx [codex] Polish issue board workflows (#4224) 2026-04-21 12:25:34 -05:00
agent-config-defaults.ts feat(codex-local): add fast mode support 2026-04-11 08:21:55 -05:00
agent-config-primitives.tsx [codex] Retry max-turn exhausted heartbeats (#5096) 2026-05-03 11:30:48 -05:00
AgentActionButtons.tsx Redesign routines UI to match issue page design language 2026-03-19 15:05:32 -05:00
AgentConfigForm.tsx [codex] Retry max-turn exhausted heartbeats (#5096) 2026-05-03 11:30:48 -05:00
AgentIconPicker.tsx Fix markdown mention chips 2026-03-23 16:57:27 -05:00
AgentProperties.tsx feat: polish inbox and issue list workflows 2026-04-10 22:26:21 -05:00
ApprovalCard.tsx Polish board approval card styling 2026-04-06 21:24:44 -05:00
ApprovalPayload.test.tsx Polish board approval card styling 2026-04-06 21:24:44 -05:00
ApprovalPayload.tsx Polish board approval card styling 2026-04-06 21:24:44 -05:00
AsciiArtAnimation.tsx feat(ui): reconcile backup UI changes with current routing and interaction features 2026-03-02 16:44:03 -06:00
BillerSpendCard.tsx feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
BreadcrumbBar.tsx [codex] Improve issue detail and issue-list UX (#3678) 2026-04-14 12:50:48 -05:00
BudgetIncidentCard.tsx [codex] add comprehensive UI Storybook coverage (#4132) 2026-04-20 12:13:23 -05:00
BudgetPolicyCard.tsx Add budget tabs and sidebar budget indicators 2026-03-16 15:11:01 -05:00
BudgetSidebarMarker.tsx [codex] add comprehensive UI Storybook coverage (#4132) 2026-04-20 12:13:23 -05:00
ClaudeSubscriptionPanel.tsx feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
CloudAccessGate.tsx feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
CodexSubscriptionPanel.tsx feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
CommandPalette.test.tsx [codex] Split PR #4692 UI/QoL updates (#4701) 2026-04-28 17:18:58 -05:00
CommandPalette.tsx [codex] Split PR #4692 UI/QoL updates (#4701) 2026-04-28 17:18:58 -05:00
CommentThread.test.tsx [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
CommentThread.tsx [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
CompanyPatternIcon.tsx feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
CompanyRail.tsx [codex] Split PR #4692 UI/QoL updates (#4701) 2026-04-28 17:18:58 -05:00
CompanySettingsSidebar.test.tsx [PAP-3180] Move workspace switcher into sidebar (#4981) 2026-05-02 08:13:53 -05:00
CompanySettingsSidebar.tsx [PAP-3180] Move workspace switcher into sidebar (#4981) 2026-05-02 08:13:53 -05:00
CompanySwitcher.tsx [codex] add comprehensive UI Storybook coverage (#4132) 2026-04-20 12:13:23 -05:00
CopyText.tsx [codex] Improve workspace navigation and runtime UI (#4089) 2026-04-20 06:14:32 -05:00
DevRestartBanner.tsx fix: address greptile follow-up feedback 2026-03-20 13:18:29 -05:00
DocumentDiffModal.tsx refactor(ui): inline document diff rendering 2026-04-06 21:43:19 -05:00
EmptyState.tsx Polish UI components and rework AgentConfigForm 2026-02-18 10:43:25 -06:00
EntityRow.tsx feat(ui): reconcile backup UI changes with current routing and interaction features 2026-03-02 16:44:03 -06:00
EnvVarEditor.tsx Add project-level environment variables 2026-04-06 21:23:30 -05:00
ExecutionParticipantPicker.tsx feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
ExecutionWorkspaceCloseDialog.tsx [codex] Respect manual workspace runtime controls (#4125) 2026-04-20 10:39:37 -05:00
FilterBar.tsx Add shared UI primitives, contexts, and reusable components 2026-02-17 09:57:00 -06:00
FinanceBillerCard.tsx feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
FinanceKindCard.tsx feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
FinanceTimelineCard.tsx feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
FoldCurtain.tsx [codex] Polish issue composer and long document display (#4420) 2026-04-24 14:12:41 -05:00
GoalProperties.tsx feat: polish inbox and issue list workflows 2026-04-10 22:26:21 -05:00
GoalTree.tsx fix(ui): render sub-goals in goal detail tree 2026-03-04 20:20:21 -07:00
HermesIcon.tsx feat(hermes): upgrade hermes-paperclip-adapter + UI adapter + skills + detectModel 2026-03-28 01:34:48 +01:00
Identity.tsx [codex] Polish issue board workflows (#4224) 2026-04-21 12:25:34 -05:00
ImageGalleryModal.tsx fix(ui): polish issue detail timelines and attachments 2026-04-02 11:51:40 -05:00
InlineEditor.test.tsx [codex] Refine markdown issue reference rendering (#4382) 2026-04-24 09:39:21 -05:00
InlineEditor.tsx [codex] Polish issue composer and long document display (#4420) 2026-04-24 14:12:41 -05:00
InlineEntitySelector.test.tsx Stabilize inline selector keyboard handling (#4617) 2026-04-27 20:04:35 -05:00
InlineEntitySelector.tsx Stabilize inline selector keyboard handling (#4617) 2026-04-27 20:04:35 -05:00
InstanceSidebar.tsx [PAP-3180] Move workspace switcher into sidebar (#4981) 2026-05-02 08:13:53 -05:00
IssueBlockedNotice.tsx Cancel stale queued heartbeats when issue graph changes (PAP-2314) (#4534) 2026-04-26 21:17:38 -05:00
IssueChatThread.test.tsx [codex] Polish inbox nested issue UI (#4959) 2026-05-01 11:58:53 -05:00
IssueChatThread.tsx Polish board settings and skills workflow (#4863) 2026-04-30 15:28:11 -05:00
IssueColumns.tsx Present ordered sub-issues as a workflow checklist (#4523) 2026-04-26 07:36:49 -05:00
IssueContinuationHandoff.test.tsx [codex] Add run liveness continuations (#4083) 2026-04-20 06:01:49 -05:00
IssueContinuationHandoff.tsx [codex] Add run liveness continuations (#4083) 2026-04-20 06:01:49 -05:00
IssueDocumentsSection.test.tsx [codex] Add run liveness continuations (#4083) 2026-04-20 06:01:49 -05:00
IssueDocumentsSection.tsx Cancel stale queued heartbeats when issue graph changes (PAP-2314) (#4534) 2026-04-26 21:17:38 -05:00
IssueFiltersPopover.test.tsx [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
IssueFiltersPopover.tsx [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
IssueGroupHeader.tsx [codex] Improve workspace runtime and navigation ergonomics (#3680) 2026-04-14 12:57:11 -05:00
IssueLinkQuicklook.tsx [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
IssueMonitorActivityCard.test.tsx [codex] Add issue monitor liveness controls (#4988) 2026-05-03 08:58:53 -05:00
IssueMonitorActivityCard.tsx [codex] Add issue monitor liveness controls (#4988) 2026-05-03 08:58:53 -05:00
IssueProperties.test.tsx [codex] Add issue monitor liveness controls (#4988) 2026-05-03 08:58:53 -05:00
IssueProperties.tsx [codex] Add issue monitor liveness controls (#4988) 2026-05-03 08:58:53 -05:00
IssueReferenceActivitySummary.tsx Add first-class issue references (#4214) 2026-04-21 10:02:52 -05:00
IssueReferencePill.tsx [codex] Refine markdown issue reference rendering (#4382) 2026-04-24 09:39:21 -05:00
IssueRelatedWorkPanel.test.tsx Add first-class issue references (#4214) 2026-04-21 10:02:52 -05:00
IssueRelatedWorkPanel.tsx Add first-class issue references (#4214) 2026-04-21 10:02:52 -05:00
IssueRow.test.tsx Present ordered sub-issues as a workflow checklist (#4523) 2026-04-26 07:36:49 -05:00
IssueRow.tsx [codex] Split PR #4692 UI/QoL updates (#4701) 2026-04-28 17:18:58 -05:00
IssueRunLedger.test.tsx [codex] Retry max-turn exhausted heartbeats (#5096) 2026-05-03 11:30:48 -05:00
IssueRunLedger.tsx [codex] Retry max-turn exhausted heartbeats (#5096) 2026-05-03 11:30:48 -05:00
IssuesList.test.tsx Improve issue thread scale and markdown polish (#4861) 2026-04-30 13:18:01 -05:00
IssuesList.tsx Improve issue thread scale and markdown polish (#4861) 2026-04-30 13:18:01 -05:00
IssuesQuicklook.tsx feat: polish inbox and issue list workflows 2026-04-10 22:26:21 -05:00
IssueThreadInteractionCard.test.tsx Add workflow interaction cancellation and issue cost summaries (#4862) 2026-04-30 13:57:25 -05:00
IssueThreadInteractionCard.tsx [codex] Polish inbox nested issue UI (#4959) 2026-05-01 11:58:53 -05:00
IssueWorkspaceCard.test.tsx Add sandbox environment support (#4415) 2026-04-24 12:15:53 -07:00
IssueWorkspaceCard.tsx [codex] Add workspace routine run tab (#4958) 2026-05-01 11:58:15 -05:00
JsonSchemaForm.tsx Add plugin framework and settings UI 2026-03-13 16:22:34 -05:00
KanbanBoard.tsx feat: polish inbox and issue list workflows 2026-04-10 22:26:21 -05:00
KeyboardShortcutsCheatsheet.tsx [codex] Polish issue board workflows (#4224) 2026-04-21 12:25:34 -05:00
Layout.test.tsx [codex] Split PR #4692 UI/QoL updates (#4701) 2026-04-28 17:18:58 -05:00
Layout.tsx [PAP-3180] Move workspace switcher into sidebar (#4981) 2026-05-02 08:13:53 -05:00
LiveRunWidget.tsx [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
MarkdownBody.test.tsx Improve issue thread scale and markdown polish (#4861) 2026-04-30 13:18:01 -05:00
MarkdownBody.tsx Improve issue thread scale and markdown polish (#4861) 2026-04-30 13:18:01 -05:00
MarkdownEditor.test.tsx Improve issue thread scale and markdown polish (#4861) 2026-04-30 13:18:01 -05:00
MarkdownEditor.tsx Improve issue thread scale and markdown polish (#4861) 2026-04-30 13:18:01 -05:00
MetricCard.tsx ui: apply interface polish from design article review 2026-03-11 08:20:24 -05:00
MobileBottomNav.tsx [codex] Split PR #4692 UI/QoL updates (#4701) 2026-04-28 17:18:58 -05:00
NewAgentDialog.tsx Add ACPX local adapter runtime (#4893) 2026-04-30 19:57:05 -05:00
NewGoalDialog.tsx fix(ui): make goal description area scrollable in create dialog 2026-04-03 23:19:50 +09:00
NewIssueDialog.test.tsx Add workflow interaction cancellation and issue cost summaries (#4862) 2026-04-30 13:57:25 -05:00
NewIssueDialog.tsx [codex] Add workspace routine run tab (#4958) 2026-05-01 11:58:15 -05:00
NewProjectDialog.tsx feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
OnboardingWizard.tsx Add ACPX local adapter runtime (#4893) 2026-04-30 19:57:05 -05:00
OpenCodeLogoIcon.tsx Add OpenCode provider integration and strict model selection 2026-03-05 15:24:20 +01:00
OutputFeedbackButtons.tsx Refine issue chat activity and message chrome 2026-04-08 06:02:34 -05:00
PackageFileTree.tsx [codex] Split reusable agent hiring templates (#4124) 2026-04-20 10:33:19 -05:00
PageSkeleton.tsx feat(ui): reconcile backup UI changes with current routing and interaction features 2026-03-02 16:44:03 -06:00
PageTabBar.tsx Refine project and agent configuration UI 2026-03-10 10:58:43 -05:00
PathInstructionsModal.tsx refactor(ui): extract ChoosePathButton into reusable PathInstructionsModal 2026-03-02 16:08:59 -06:00
PriorityIcon.tsx refactor(ui): standardize status/priority colors and improve text legibility 2026-02-23 19:52:43 -06:00
ProductivityReviewBadge.tsx [codex] Split PR #4692 UI/QoL updates (#4701) 2026-04-28 17:18:58 -05:00
ProjectProperties.tsx Add sandbox environment support (#4415) 2026-04-24 12:15:53 -07:00
ProjectWorkspacesContent.tsx [codex] Improve workspace navigation and runtime UI (#4089) 2026-04-20 06:14:32 -05:00
ProjectWorkspaceSummaryCard.test.tsx [codex] Polish issue board workflows (#4224) 2026-04-21 12:25:34 -05:00
ProjectWorkspaceSummaryCard.tsx [codex] Respect manual workspace runtime controls (#4125) 2026-04-20 10:39:37 -05:00
PropertiesPanel.tsx feat: polish inbox and issue list workflows 2026-04-10 22:26:21 -05:00
ProviderQuotaCard.tsx feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
QuotaBar.tsx feat(ui): add resource and usage dashboard (/usage route) 2026-03-16 15:08:54 -05:00
ReportsToPicker.tsx refactor: improve layout and truncation in ReportsToPicker 2026-03-20 20:33:36 +00:00
RoutineRunVariablesDialog.test.tsx [codex] Add workspace routine run tab (#4958) 2026-05-01 11:58:15 -05:00
RoutineRunVariablesDialog.tsx [codex] Add workspace routine run tab (#4958) 2026-05-01 11:58:15 -05:00
RoutineVariablesEditor.tsx [codex] Split PR #4692 UI/QoL updates (#4701) 2026-04-28 17:18:58 -05:00
RunChatSurface.tsx [codex] Harden dashboard run activity charts (#4126) 2026-04-20 10:34:21 -05:00
RunInvocationCard.test.tsx feat(adapters): external adapter plugin system with dynamic UI parser 2026-04-03 21:11:20 +01:00
ScheduleEditor.tsx Fix schedule time picker: cleaner hour labels, hide selectors for every-minute 2026-03-19 17:29:09 -05:00
ScrollToBottom.tsx Offset scroll-to-bottom button when properties panel is open 2026-04-06 21:24:44 -05:00
Sidebar.test.tsx [codex] Split PR #4692 UI/QoL updates (#4701) 2026-04-28 17:18:58 -05:00
Sidebar.tsx [codex] Split PR #4692 UI/QoL updates (#4701) 2026-04-28 17:18:58 -05:00
SidebarAccountMenu.test.tsx feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
SidebarAccountMenu.tsx [codex] add comprehensive UI Storybook coverage (#4132) 2026-04-20 12:13:23 -05:00
SidebarAgents.test.tsx [codex] Split PR #4692 UI/QoL updates (#4701) 2026-04-28 17:18:58 -05:00
SidebarAgents.tsx [codex] Split PR #4692 UI/QoL updates (#4701) 2026-04-28 17:18:58 -05:00
SidebarCompanyMenu.test.tsx [PAP-3180] Move workspace switcher into sidebar (#4981) 2026-05-02 08:13:53 -05:00
SidebarCompanyMenu.tsx [PAP-3180] Move workspace switcher into sidebar (#4981) 2026-05-02 08:13:53 -05:00
SidebarNavItem.tsx feat: polish inbox and issue list workflows 2026-04-10 22:26:21 -05:00
SidebarProjects.tsx [codex] Split PR #4692 UI/QoL updates (#4701) 2026-04-28 17:18:58 -05:00
SidebarSection.tsx Remove collapsible behavior from sidebar Work and Company sections 2026-02-20 15:08:03 -06:00
StatusBadge.tsx [codex] Harden heartbeat scheduling and runtime controls (#4223) 2026-04-21 12:24:11 -05:00
StatusIcon.test.tsx Cancel stale queued heartbeats when issue graph changes (PAP-2314) (#4534) 2026-04-26 21:17:38 -05:00
StatusIcon.tsx Cancel stale queued heartbeats when issue graph changes (PAP-2314) (#4534) 2026-04-26 21:17:38 -05:00
SwipeToArchive.test.tsx Add dark mode inbox selection color 2026-03-30 14:14:14 -05:00
SwipeToArchive.tsx [codex] Polish inbox nested issue UI (#4959) 2026-05-01 11:58:53 -05:00
ToastViewport.tsx [codex] Harden execution reliability and heartbeat tooling (#3679) 2026-04-14 13:34:52 -05:00
WorkspaceRuntimeControls.test.tsx [codex] Harden heartbeat runtime cleanup (#4233) 2026-04-21 16:48:47 -05:00
WorkspaceRuntimeControls.tsx [codex] Improve workspace navigation and runtime UI (#4089) 2026-04-20 06:14:32 -05:00
WorktreeBanner.tsx Make worktree banner name clickable to copy to clipboard 2026-04-09 06:18:05 -05:00