paperclip/server/src/routes
Dotta c4269bab59
Add workflow interaction cancellation and issue cost summaries (#4862)
## Thinking Path

> - Paperclip coordinates work through issue-thread interactions, run
history, and cost telemetry.
> - Operators need workflow prompts to be cancellable and costs to be
visible at the issue level.
> - The earlier rollup mixed this workflow/cost work with database
backups, reliability recovery, thread scaling, and settings polish.
> - This pull request isolates the interaction and cost surfaces into a
reviewable slice.
> - The backend now supports cancelling pending question interactions
and summarizing issue-tree costs.
> - The UI component layer can render cancelled questions and interleave
activity with run ledger rows.

## What Changed

- Added `cancelled` as an issue-thread interaction status and result
shape for question interactions.
- Added the board-only `POST
/issues/:id/interactions/:interactionId/cancel` route and service
implementation.
- Added issue-tree cost summary support in the cost service and
`/issues/:id/cost-summary` API route.
- Extended shared cost exports and UI API/query keys for issue cost
summaries.
- Updated `IssueThreadInteractionCard` and `IssueRunLedger` components
for cancelled questions, issue cost surfaces, and activity/run
interleaving.
- Added focused server and component regression coverage.

## Verification

- `pnpm install --frozen-lockfile`
- `pnpm exec vitest run server/src/__tests__/costs-service.test.ts
server/src/__tests__/issue-thread-interaction-routes.test.ts
server/src/__tests__/issue-thread-interactions-service.test.ts
ui/src/components/IssueRunLedger.test.tsx`
- Result: 4 test files passed, 45 tests passed.
- UI screenshots not included because this PR updates reusable
components and API surfaces without wiring a new page-level layout.

## Risks

- Adds a new interaction terminal status; clients that switch
exhaustively on interaction status may need to handle `cancelled`.
- Issue-tree cost summaries use recursive issue traversal and should be
watched on unusually large issue trees.
- Page-level issue detail wiring is intentionally left to the board
QoL/issue-detail branch to keep this PR narrow.

> 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, GPT-5.5, code execution and GitHub CLI tool use, medium
reasoning effort.

## 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-04-30 13:57:25 -05:00
..
access.ts Fix SSH callback URL selection for LAN and private networks (#4799) 2026-04-29 15:56:17 -07:00
activity.ts [codex] Harden heartbeat scheduling and runtime controls (#4223) 2026-04-21 12:24:11 -05:00
adapters.ts fix(adapters/routes): apply resolveExternalAdapterRegistration on hot-install (#4324) 2026-04-23 09:45:24 -05:00
agents.ts Add dedicated environment settings page and test-in-environment (#4798) 2026-04-29 15:56:13 -07:00
approvals.ts Add sandbox environment support (#4415) 2026-04-24 12:15:53 -07:00
assets.ts Use attachment-size limit for company logos 2026-03-16 10:13:19 -05:00
auth.ts feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
authz.ts feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
companies.ts Harden API route authorization boundaries (#4122) 2026-04-20 10:56:48 -05:00
company-skills.ts Address Greptile telemetry review comments 2026-04-03 14:11:11 -05:00
costs.ts Add workflow interaction cancellation and issue cost summaries (#4862) 2026-04-30 13:57:25 -05:00
dashboard.ts refactor: rename packages to @paperclipai and CLI binary to paperclipai 2026-03-03 08:45:26 -06:00
environment-selection.ts Add sandbox environment support (#4415) 2026-04-24 12:15:53 -07:00
environments.ts Generalize sandbox provider core for plugin-only providers (#4449) 2026-04-24 18:03:41 -07:00
execution-workspaces.ts [codex] Respect manual workspace runtime controls (#4125) 2026-04-20 10:39:37 -05:00
goals.ts Add versioned telemetry events 2026-04-03 09:25:00 -05:00
health.ts [codex] Add backup endpoint and dev runtime hardening (#4087) 2026-04-20 06:08:55 -05:00
inbox-dismissals.ts Persist non-issue inbox dismissals 2026-04-09 06:16:05 -05:00
index.ts [codex] Add issue subtree pause, cancel, and restore controls (#4332) 2026-04-23 14:51:46 -05:00
instance-database-backups.ts [codex] Add backup endpoint and dev runtime hardening (#4087) 2026-04-20 06:08:55 -05:00
instance-settings.ts [codex] Add configurable liveness auto-recovery controls (#4587) 2026-04-27 08:46:44 -05:00
issue-tree-control.ts [codex] Split backend control-plane QoL slice (#4700) 2026-04-28 16:46:45 -05:00
issues-checkout-wakeup.ts Cut over OpenClaw adapter to strict SSE streaming 2026-03-05 15:54:55 -06:00
issues.ts Add workflow interaction cancellation and issue cost summaries (#4862) 2026-04-30 13:57:25 -05:00
llms.ts [codex] Harden create-agent skill governance (#4422) 2026-04-24 14:15:28 -05:00
org-chart-svg.ts Improve generated company org chart assets 2026-03-23 16:58:07 -05:00
plugin-ui-static.ts Add plugin framework and settings UI 2026-03-13 16:22:34 -05:00
plugins.ts Harden API route authorization boundaries (#4122) 2026-04-20 10:56:48 -05:00
projects.ts [codex] Split backend control-plane QoL slice (#4700) 2026-04-28 16:46:45 -05:00
routines.ts Keep manual routine runs visible in the runner inbox (#4615) 2026-04-27 20:03:24 -05:00
secrets.ts refactor: rename packages to @paperclipai and CLI binary to paperclipai 2026-03-03 08:45:26 -06:00
sidebar-badges.ts feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
sidebar-preferences.ts [codex] Improve workspace runtime and navigation ergonomics (#3680) 2026-04-14 12:57:11 -05:00
user-profiles.ts [codex] Add access cleanup and user profile page (#4088) 2026-04-20 06:10:20 -05:00
workspace-command-authz.ts [codex] harden authenticated routes and issue editor reliability (#3741) 2026-04-15 08:41:15 -05:00
workspace-runtime-service-authz.ts [codex] harden authenticated routes and issue editor reliability (#3741) 2026-04-15 08:41:15 -05:00