fix(clients): restart continuations show as a T3 Code notice, not another agent's message #17723
main fromrefs/pull/17723/head·merged by juliusmarminge View on GitHubProblem#
After a server restart, T3 Code prompts each interrupted turn to continue. That prompt was stored as an ordinary user message created by the agent, so the timeline showed it as your own bubble labelled "Sent by another agent". Nothing else sent it.
Change#
A restart continuation is now a T3 Code notice, shown the same way as background task and delegated task wakes.
- Contract: notification sources gain a
systemkind. The source union already reads unknown kinds asbackground_task, so older clients show a generic row instead of failing. - Server:
continueRestartedRunattaches asystemnotification to the continuation. The summary is "T3 Code restarted and resumed this turn", or "T3 Code restarted and stopped background work" when only background work was lost, and the detail is the prompt the agent received. The orchestrator only accepted notifications on queued messages; it now also accepts one on a restart continuation, which starts immediately to resume the cut turn. The text the provider receives is unchanged. - Web: a
systemnotice uses the T3 icon and expands to the prompt. - Mobile: a
systemnotice uses the bolt icon. Expanding any notification now shows its detail text instead of the item as JSON. - Older history: continuations already saved as user messages are labelled "Sent by T3 Code" instead of "Sent by another agent". Messages that MCP tools and providers send between threads keep "Sent by another agent".
Scope and approval#
Maintainer request (Julius): restart notices should say they come from T3 Code, then should not show as a user message at all, but as a collapsed work log row like the background update rows. The automatic "Continue where you left off." after a usage limit resets is still stored as a user-authored message. Changing that changes how adapters and thread settlement treat the turn, so it is left for a separate PR.
Verification#
apps/server:RestartContinuation.test.tsasserts the continuation carries thesystemnotice with the prompt as detail.runtimeLayer.test.tsdispatches a restart continuation with the notice through the real orchestrator and asserts the run has anotificationturn item and nouser_messageitem, and that a retried or stale continuation still does not add a run. The restart note replay and delegated completion suites pass unchanged.packages/contracts,packages/client-runtime(userMessage.test.ts: server-sent continuations get "Sent by T3 Code", MCP and provider messages still get "Sent by another agent"),apps/mobile(threadActivity.test.ts: asystemnotice expands to its prompt), and theapps/webtimeline suites pass.- Typecheck is clean for contracts, client-runtime, provider-core, shared, provider-acp, web, mobile, and server.
- Web, checked in the Browser panel against a dev database copied from real data. The thread is a real one where the server restarted mid-turn. "Before" runs the
mainclient on the stored message. "After" runs this branch with the message stored the way this branch now writes it.
Before: the continuation is a user bubble, "Sent by another agent".

After: a collapsed work log row from T3 Code.

After, expanded: the prompt the agent received.

Not checked: the mobile change (icon and expanded detail text) has unit coverage but was not run in a simulator. I did not trigger a live server restart end to end; the server path is covered by the orchestrator test above.
Claude Opus 5.5 in Claude Code, driven from T3 Code.
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
juliusmarminge added labelsmacroscope-review
Approvability#
Verdict: Approved at
702cb0dMacroscope's review found this PR approvable — This is a focused restart-recovery bug fix that preserves agent-facing behavior while changing only the event attribution and work-log presentation across supported clients. The additive contract and orchestration changes are covered by targeted tests and do not alter product defaults or introduce sensitive or deployment-related behavior.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 5.0 KiB 4.9 KiB −23 B (−0.5%) 6.8 KiB ✅ Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB −23 B (−1.9%) 2.0 KiB ✅ Codex Live turn WebSocket decoded 20.9 KiB 20.8 KiB −41 B (−0.2%) 29.3 KiB ✅ Codex Live turn messages 2 1 −1 (−50.0%) 8 ✅ Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅ Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅ Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅ Claude Live turn messages 2 2 0 (0.0%) 8 ✅ Baseline:
fa9f936· PR result:702cb0d· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Team
- Run ID:
a95af61b-38af-4730-8b8c-4ecf65bc23e0
📥 Commits
-
Reviewing files that changed from the base of the PR and between fa9f936ef5cbbe4bd4f9890b638766fc92f45075 and 702cb0d812f5804dc7e0b094c6a15f570ad2d1bc.
📒 Files selected for processing (12)
-
apps/mobile/src/features/threads/ThreadFeed.tsxapps/mobile/src/lib/threadActivity.test.tsapps/mobile/src/lib/threadActivity.tsapps/server/src/orchestration-v2/Orchestrator.tsapps/server/src/orchestration-v2/RestartContinuation.test.tsapps/server/src/orchestration-v2/RestartContinuation.tsapps/server/src/orchestration-v2/runtimeLayer.test.tsapps/web/src/components/chat/MessagesTimeline.tsxpackages/client-runtime/src/state/threadExecution.tspackages/client-runtime/src/userMessage.test.tspackages/client-runtime/src/userMessage.tspackages/contracts/src/orchestrationV2.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
📝 Walkthrough
-
Walkthrough#
The change adds explicit message attribution for automation, agents, and T3 Code. Restart continuations now dispatch system notifications with a summary and prompt detail. Client views handle the new notification source and display its detail.
Changes#
T3 Code attribution and restart notifications
Layer / File(s) Summary Resolve and display message attribution
packages/client-runtime/src/userMessage.ts,packages/client-runtime/src/userMessage.test.ts,apps/mobile/src/features/threads/ThreadFeed.tsx,apps/web/src/components/chat/MessagesTimeline.tsxThe resolver returns automation,agent,t3code, ornullattribution. Mobile and web views use that value to select message labels.Dispatch restart notifications
packages/contracts/src/orchestrationV2.ts,apps/server/src/orchestration-v2/RestartContinuation.ts,apps/server/src/orchestration-v2/Orchestrator.ts,apps/server/src/orchestration-v2/RestartContinuation.test.ts,apps/server/src/orchestration-v2/runtimeLayer.test.tsThe notification source contract adds system. Restart continuations dispatch a system notification with an outcome, summary, and continuation text as detail. Dispatch validation permits these notifications withstart_immediately.Present system notifications
apps/mobile/src/lib/threadActivity.ts,apps/mobile/src/lib/threadActivity.test.ts,apps/web/src/components/chat/MessagesTimeline.tsx,packages/client-runtime/src/state/threadExecution.tsSystem notifications receive their corresponding icons. Notification detail is returned when no read paths are available, and system notifications do not resolve to child thread IDs. Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Sequence Diagram(s)#
sequenceDiagram participant RestartContinuation participant Orchestrator participant RuntimeTurnItems participant MessagesTimeline RestartContinuation->>Orchestrator: Dispatch continuation with system notification Orchestrator->>RuntimeTurnItems: Process continuation command RuntimeTurnItems->>MessagesTimeline: Provide notification turn item with summary and detailSuggested reviewers:
maria-rcks,t3dotgg
Merge Risk: ⚪ Minimal · up to
702cbThe restart notice and message attribution changes are ready to merge after normal checks.
Pre-merge checks |
4-
✅ Passed checks (4 passed)
-
Check name Status Explanation Title check The title clearly and concisely describes the main change: restart continuations now appear as T3 Code notices instead of agent messages. Description check The description includes all required sections, explains the problem and implementation, documents scope and approval context, and provides focused verification results, screenshots, and known limitat… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request.
-
✨ Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment `@coderabbitai help` to get the list of available commands.-
juliusmarminge merged thisa7223f3
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes