Repository navigation
feat(ui): unify system notices in chat with a minimal line family - #122144
Conversation
Class A (model-facing system turns: restart recovery, gateway restarted, generic internal_system fallback) and class B (lifecycle facts: compaction) now share one hairline+icon+label rendering; known kinds show operator summaries instead of raw injected prompts. Core producers share one formatSystemTurnPrompt owner for the [System] prefix; subagent resume copy unified from "gateway reload" to "gateway restart". No protocol, channel, or marker changes.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 11, 2026, 12:53 PM ET / 16:53 UTC. ClawSweeper reviewWhat this changesThe PR gives Control UI system turns and compaction markers a shared minimal notice presentation, with concise labels for known restart events and one common system-prompt formatter for recovery producers. Merge readiness✅ Ready for maintainer review No blocking correctness or security finding was identified. This maintainer-authored, Likely related people: Peter Steinberger — recent area contributor (medium confidence). Priority: P3 Review scores
Verification
How this fits togetherRecovery and lifecycle code persist internal messages and compaction markers in session history. Control UI converts those records into chat items, classifies recognized system sources, and renders an operator-facing transcript row. flowchart LR
A[Recovery producers] --> B[Session history]
C[Compaction markers] --> B
B --> D[Chat item builder]
D --> E[System notice registry]
E --> F[Notice and divider renderer]
F --> G[Control UI transcript]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +133, Tests +86. Total +219 across 19 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep fixed operator summaries limited to recognized non-variable producer kinds, preserve generic variable system notices, and land only after exact-head checks complete. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR changes an existing Control UI presentation rather than reporting a failing behavior; its mocked browser fixture directly covers the affected rows. Is this the best way to solve the issue? Yes: classifying known provenance at the chat-item boundary and centralizing the shared prompt prefix avoids duplicating UI inference or producer formatting. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e7ba2e1f6b1f. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Relocate formatSystemTurnPrompt to src/sessions/system-turn-prompt.ts so the core-internal [System] convention does not widen the SDK API baseline; drop the unused prefix/type exports; use var(--cursor-action) per cursor policy.
|
Merged via squash.
|
…enclaw#122144) * feat(ui): unify system notices in chat with a minimal line family Class A (model-facing system turns: restart recovery, gateway restarted, generic internal_system fallback) and class B (lifecycle facts: compaction) now share one hairline+icon+label rendering; known kinds show operator summaries instead of raw injected prompts. Core producers share one formatSystemTurnPrompt owner for the [System] prefix; subagent resume copy unified from "gateway reload" to "gateway restart". No protocol, channel, or marker changes. * fix(ui): keep system-turn prompt helper out of the plugin SDK surface Relocate formatSystemTurnPrompt to src/sessions/system-turn-prompt.ts so the core-internal [System] convention does not widen the SDK API baseline; drop the unused prefix/type exports; use var(--cursor-action) per cursor policy.
What Problem This Solves
System-generated messages in the Control UI chat grew as four unrelated mechanisms and render as different visual species:
[System] ...string; the UI regex-strips the prefix and dumps the raw model prompt as operator-facing copy under a bare "SYSTEM" label.There was also no reusable seam for adding the next lifecycle notice.
Why This Change Was Made
Maintainer-requested unification (design discussed and mocked up in-session). The design splits system messages into two explicit classes sharing one minimal visual family:
internal_systemprovenance kinds as a hairline + icon +SYSTEM · <kind>label with one friendly operator summary line. The raw prompt is no longer shown for known kinds (no exact-prompt view by design).Producer-side, one shared helper now owns the
[System]prefix; the subagent resume copy is unified to "gateway restart". Channels never see any of this (unchanged). No protocol or__openclawmarker changes.User Impact
Before
After
Both screenshots are the same mocked-gateway fixture (restart-recovery turn + compaction marker) rendered through the Control UI e2e harness (Playwright/Chromium, dark theme) on pre-change vs post-change code.
Evidence
ui/src/pages/chat/chat-thread.test.ts+chat-view.test.ts+components/chat-message.test.ts— 594 passed;system-notice-kinds.test.ts— 7 passed;src/sessions/input-provenance.test.ts— 23 passed;src/auto-reply/reply/stranded-reply-recovery.test.ts+subagent-registry-restart-recovery-helpers.test.ts— passed; main/subagent restart-recovery suites — 300 passed.pnpm ui:i18n:baselineclean (source keys 4726);pnpm lint:ui:stylesclean;git diff --checkclean.internal_systemprovenance — the retry prompt is never persisted (transcriptPrompt/user-message persistence suppressed) and adding provenance would flip delivery-interactivity, reply-policy, and actor-classification branches.formatSystemTurnPromptlives insrc/sessions/system-turn-prompt.ts(notinput-provenance.ts) deliberately: input-provenance is type-reachable from 18 plugin SDK entrypoints, and this prompt convention is core-internal — plugins keep usingprefixSystemMessage. The SDK API baseline is untouched.