Files
PaperClipAI/ui/src/context
Nicky LeachandClaude Opus 5.5 1a726eaccf feat(ui): name a run's startup stage instead of Thinking (#22956)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - The task view's runner turn shows a status header and a
current-activity line while an agent works.
> - From the claim until the agent's turn starts, that line says
"Thinking", even while the run acquires its environment, restores its
session or connects tools.
> - The stacked pull request below this one makes the server publish
each run's startup stage.
> - This pull request shows "Getting ready" from message submission,
then the server's stage after the claim, instead of "Thinking". It holds
each shown stage briefly so fast steps do not flicker.
> - The benefit is that a person can see why a turn has not started yet.

## Linked Issues or Issue Description

No public issue exists. Stacked on #22953, which adds the server side.

**Subsystem affected**
Task chat runner turn (`ui/src/components/task-chat`), live run updates
(`ui/src/context/LiveUpdatesProvider.tsx`) and `DESIGN.md`.

**Problem or motivation**
A cold start can spend many seconds on setup before the agent's first
event. The activity line says "Thinking" for all of it, so a slow start
looks like a slow model.

**Proposed solution**
Start a queued turn on "Getting ready", which is also the server's first
stage after the claim, so the line does not change at the claim. Then
name the server's startup stage until the agent's turn starts. Keep the
header and the 30-second "Waiting to start" rule as they are.

**Alternatives considered**
A trailing debounce (show a stage only after it lasts some time). It
delays every stage by the same amount and still cannot tell whether a
step will continue. This change shows each stage at once and only holds
a shown stage for a minimum time.

## What Changed

- `run-startup-stage.ts` (new): the stage labels (`Getting ready`,
`Waking up`, `Preparing workspace`, `Restoring session`, `Connecting
tools`, `Starting agent`, and `Resuming session` for a resumed provider
session) and `useHeldLabel`. A changed label shows at once when the
current one has been visible for 500 ms. Otherwise the latest label
shows when the 500 ms end, and labels in between are skipped.
- `TaskChatRunnerTurn`: the current-activity line of a queued turn shows
"Getting ready" instead of "Thinking", from message submission. A
running (claimed) run shows the held server stage. Stages shimmer like
"Thinking". Named holds (for example waiting for a provider) still win,
and a turn still queued after 30 seconds with no named hold still says
"Waiting to start". The header keeps "Working". "Thinking" begins when
the agent's turn starts.
- `TaskChatThread`: passes the live run's `startupStage` and
`startupSessionResumed` to the runner turn.
- `LiveUpdatesProvider`: the `heartbeat.run.startup_stage` event patches
cached runs. It drops unknown stages and does not refetch.
- `DESIGN.md`: a queued turn's activity line is now "Getting ready"
instead of "Thinking", and a new paragraph next to the queued-turn rule
describes the stages.

## Verification

- `npx vitest run src/components/task-chat/run-startup-stage.test.ts`:
labels, immediate change after the hold, the hold and skip to the latest
label, the return to the default, and an undone change.
- `npx vitest run src/components/TaskChatThread.test.tsx`: a claimed run
shows its stage and keeps the "Working" header, a resumed session shows
"Resuming session", agent activity replaces the stage, and a queued run
shows no server stage. The existing admission tests now expect "Getting
ready" where they expected "Thinking", and the mounted-through-startup
test checks that the line stays "Getting ready" across the claim. The
two tests that check for no startup feedback also reject "Getting
ready".
- `npx vitest run src/context/LiveUpdatesProvider.test.ts`: the event
becomes a cache patch and unknown stages are dropped.
- `npx vitest run src/components/TaskChatThread.test.tsx
src/components/IssueChatThread.test.tsx src/components/task-chat`: 932
tests pass. `pnpm --filter @paperclipai/ui typecheck` passes.
- CI runs the full suite.

## Risks

- Low risk. The change is presentation only. If the server sends no
stage (an older server, or after a restart), the line shows "Thinking"
as before.
- Queued turns now say "Getting ready" instead of "Thinking" during
admission. The 30 second grace, the "Waiting to start" rule and named
holds are unchanged.

## Model Used

- Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, with tool use
(shell, file edits).

## 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
- [x] All Paperclip CI gates are green
- [x] 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>
2026-11-30 16:22:08 +00:00
..