## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work
> - A message posted while a run is starting goes into that run's first
turn, and the task page shows it as sent
> - The page shows it as sent only while the live queue lists it as a
first-turn message
> - When that queue closes, for example after a later Steer, the page
has no lasting record of the delivery
> - It then infers that the message is queued and shows it again with a
Steer button
> - This pull request reports each run's own first-turn receipt in the
run list, and the page places those messages in that run
> - The benefit is that a sent message stays sent
## Linked Issues or Issue Description
Follow-up to #21661, found while I verified that change on staging.
**What happened?**
With a Codex runner, two messages were posted while the run was
starting. The first turn took them and the agent acted on both. Then a
third message was steered into the running turn. After the Steer, the
first two messages came back into the queue with Steer buttons. The
server queue was empty.
**Expected behavior**
Messages that a run's first turn took stay in the conversation as
delivered.
**Steps to reproduce**
1. Start a task with a Paperclip runner agent.
2. While the runner is starting, post one or two messages.
3. After the turn starts, post another message and click Steer.
## What Changed
- `activityService.runsForIssue` returns `firstTurnCommentIds` from the
run's `firstTurnQueuedInput` receipt. The field is set only when the
receipt names this run, because a retry copies its predecessor's
context.
- `IssueDetail` adds those ids to the run's start inputs, so the
messages are placed in that run and are not inferred as queued.
- `RunForIssue` type gets the new optional field.
## Verification
Red/green tests. Each failed before the fix and passes after it:
- `server/src/__tests__/activity-service.test.ts`: "reports the queued
messages a run's own first turn took, not a predecessor's". 33/33 pass.
- `ui/src/pages/IssueDetail.test.tsx`: "keeps a message the running turn
already took out of the queue after the live queue closes". The
IssueDetail, queue helper, and task-chat suites pass (69 files, 1298
tests). UI typecheck passes.
Staging, after #21661 deployed, Codex runner: two messages posted while
the run started were taken into the first turn and acted on. No
Interrupt, error banner, or composer wait was shown. A mid-turn Steer
was accepted in seconds. This PR fixes the one defect that the check
found.
## Risks
- Low. One new read-only field on the run list. A run that took messages
and then failed before its provider accepted the turn now shows those
messages in that run. The next run still delivers them, and the queue
still lists them while they wait.
## Model Used
- Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, with tool use and
code 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 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
- [ ] All Paperclip CI gates are 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
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>