Repository navigation
Control UI + auto-reply: strip leaked agent scaffolding and metadata - #68045
miyago9267 wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbca5dc88f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| * — each continuation line re-uses the same prefix for safety, so a simple | ||
| * consecutive-line sweep is sufficient to remove them. | ||
| */ | ||
| const SYSTEM_EVENT_LINE_RE = /^System(?: \(untrusted\))?:/; |
There was a problem hiding this comment.
Restrict system-line stripping to trusted metadata shapes
The new SYSTEM_EVENT_LINE_RE/instruction-prefix checks remove any user line that begins with System: or Current time:, even when it is legitimate user content (for example pasted logs, YAML headers, or prompts that intentionally start with those labels). Because stripInboundMetadata is used beyond chat rendering (for example command detection and session sanitization paths), this overbroad match can silently delete real user input and change downstream behavior. Please gate these removals on a stronger signature (for example the emitted event timestamp format) instead of raw line prefixes.
Useful? React with 👍 / 👎.
| // inbound metadata sentinels are stripped before render. Previously the | ||
| // reduced text was rendered verbatim, leaking <final>…</final> tags and | ||
| // injected "Sender (untrusted metadata):" blocks into the Control UI. | ||
| const extractedText = rawExtractedText ? processMessageText(rawExtractedText, role) : ""; |
There was a problem hiding this comment.
Preserve reasoning-only assistant turns after text stripping
Routing grouped assistant text through processMessageText strips <think>...</think> scaffolding before visibility checks, so an assistant turn that contains reasoning tags but no <final> content now produces empty markdown and is suppressed by the existing empty-bubble guard. In that scenario the entire message disappears (including the reasoning panel path), which is a regression from prior behavior where the turn was still visible. Consider treating extracted reasoning as visible content when deciding whether to render the bubble/group.
Useful? React with 👍 / 👎.
Greptile SummaryThis PR fixes three related bugs where Control UI leaks AI-facing scaffolding and injected metadata into user-visible chat: Confidence Score: 5/5Safe to merge — all remaining findings are P2 style/consistency suggestions that do not affect current runtime behaviour. The three bugs are correctly identified and fixed, tests cover the key variants including edge cases (inline "Operating System: Linux" prose preservation, empty-think tag, orphan group suppression), and the changes are tightly scoped. The inline comments are minor inconsistencies and a performance observation.
|
| const shouldStripInboundMetadata = normalizeLowercaseStringOrEmpty(role) === "user"; | ||
| if (role === "assistant") { | ||
| return stripThinkingTags(text); |
There was a problem hiding this comment.
Inconsistent role comparison — assistant branch is case-sensitive, user branch is not
role === "assistant" is a strict equality check, but normalizeLowercaseStringOrEmpty(role) === "user" normalises to lowercase first. A message with role: "Assistant" would skip the thinking-tag strip path and fall through to stripEnvelope only. Both branches should use the same normalisation strategy for consistency.
| const shouldStripInboundMetadata = normalizeLowercaseStringOrEmpty(role) === "user"; | |
| if (role === "assistant") { | |
| return stripThinkingTags(text); | |
| const normalizedRole = normalizeLowercaseStringOrEmpty(role); | |
| if (normalizedRole === "assistant") { | |
| return stripThinkingTags(text); | |
| } | |
| return normalizedRole === "user" |
Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/ui/chat/message-extract.ts
Line: 11-13
Comment:
**Inconsistent role comparison — assistant branch is case-sensitive, user branch is not**
`role === "assistant"` is a strict equality check, but `normalizeLowercaseStringOrEmpty(role) === "user"` normalises to lowercase first. A message with `role: "Assistant"` would skip the thinking-tag strip path and fall through to `stripEnvelope` only. Both branches should use the same normalisation strategy for consistency.
```suggestion
const normalizedRole = normalizeLowercaseStringOrEmpty(role);
if (normalizedRole === "assistant") {
return stripThinkingTags(text);
}
return normalizedRole === "user"
```
How can I resolve this? If you propose a fix, please make it concise.| const groupHasVisibleContent = group.messages.some(({ message }) => { | ||
| const m = message as Record<string, unknown>; | ||
| const role = typeof m.role === "string" ? m.role : ""; | ||
| const normalized = normalizeMessage(message); | ||
| const rawText = normalized.content | ||
| .reduce<string[]>((acc, item) => { | ||
| if (item.type === "text" && typeof item.text === "string") { | ||
| acc.push(item.text); | ||
| } | ||
| return acc; | ||
| }, []) | ||
| .join("\n") | ||
| .trim(); | ||
| if (rawText && processMessageText(rawText, role).trim()) { | ||
| return true; | ||
| } | ||
| if (extractImages(message).length > 0) { | ||
| return true; | ||
| } | ||
| if (normalized.replyTarget) { | ||
| return true; | ||
| } | ||
| if (normalized.content.some((item) => item.type === "attachment" || item.type === "canvas")) { | ||
| return true; | ||
| } | ||
| // Only count tool cards when the user has tool-call display enabled. | ||
| if ((opts.showToolCalls ?? true) && extractToolCards(message, "group-precheck").length > 0) { | ||
| return true; | ||
| } | ||
| return false; | ||
| }); | ||
| if (!groupHasVisibleContent) { | ||
| return nothing; |
There was a problem hiding this comment.
Precheck duplicates work already done inside
renderGroupedMessage
groupHasVisibleContent calls normalizeMessage, processMessageText, extractImages, and extractToolCards for every message in the group. renderGroupedMessage performs the same calls immediately after. For groups with many messages or in chat histories with many groups this doubles the computation on every render cycle. Consider memoising the precheck result or restructuring so that each message renders itself and the group-level suppression is inferred from the nothing returns.
Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/ui/chat/grouped-render.ts
Line: 172-204
Comment:
**Precheck duplicates work already done inside `renderGroupedMessage`**
`groupHasVisibleContent` calls `normalizeMessage`, `processMessageText`, `extractImages`, and `extractToolCards` for every message in the group. `renderGroupedMessage` performs the same calls immediately after. For groups with many messages or in chat histories with many groups this doubles the computation on every render cycle. Consider memoising the precheck result or restructuring so that each message renders itself and the group-level suppression is inferred from the `nothing` returns.
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Pull request overview
This PR fixes user-facing text leaks in Control UI (and other surfaces using stripInboundMetadata) by ensuring assistant/user message text is consistently processed to remove model scaffolding (<think>/<final>) and injected inbound metadata, and by suppressing empty message groups after stripping.
Changes:
- Export
processMessageTextand add tests covering assistant scaffolding stripping and user metadata stripping. - Update Control UI grouped rendering to run extracted text through
processMessageTextand suppress groups that would render empty. - Extend
stripInboundMetadatato also strip per-lineSystem:/System (untrusted):prefixes and certain internal instruction lines, with new test coverage.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/ui/chat/message-extract.ts | Exports processMessageText for reuse across renderers. |
| ui/src/ui/chat/message-extract.test.ts | Adds unit tests for processMessageText behavior across roles. |
| ui/src/ui/chat/grouped-render.ts | Uses processMessageText for grouped message rendering and adds group-level suppression for empty groups. |
| src/auto-reply/reply/strip-inbound-meta.ts | Expands inbound stripping to include system-event line prefixes and internal instruction lines. |
| src/auto-reply/reply/strip-inbound-meta.test.ts | Adds tests for the new per-line stripping behavior and a formatting tweak to an existing assertion. |
| CHANGELOG.md | Documents the UI and auto-reply stripping fixes. |
| const m = message as Record<string, unknown>; | ||
| const role = typeof m.role === "string" ? m.role : ""; | ||
| const normalized = normalizeMessage(message); | ||
| const rawText = normalized.content | ||
| .reduce<string[]>((acc, item) => { | ||
| if (item.type === "text" && typeof item.text === "string") { | ||
| acc.push(item.text); | ||
| } | ||
| return acc; | ||
| }, []) | ||
| .join("\n") | ||
| .trim(); | ||
| if (rawText && processMessageText(rawText, role).trim()) { |
There was a problem hiding this comment.
renderMessageGroup’s new groupHasVisibleContent precheck rebuilds text from normalizeMessage(...).content and runs it through processMessageText. For assistant messages this loses phase information (textSignature is discarded by normalizeMessage), so commentary-only blocks / non-final_answer text can be treated as visible and prevent group suppression (and may later render) even though extractTextCached would hide them. Prefer using extractTextCached(message) (and checking .trim()) for the text visibility check so the precheck matches the established assistant-visible-text contract (final_answer preference, no commentary-only fallback).
| const m = message as Record<string, unknown>; | |
| const role = typeof m.role === "string" ? m.role : ""; | |
| const normalized = normalizeMessage(message); | |
| const rawText = normalized.content | |
| .reduce<string[]>((acc, item) => { | |
| if (item.type === "text" && typeof item.text === "string") { | |
| acc.push(item.text); | |
| } | |
| return acc; | |
| }, []) | |
| .join("\n") | |
| .trim(); | |
| if (rawText && processMessageText(rawText, role).trim()) { | |
| const normalized = normalizeMessage(message); | |
| const visibleText = extractTextCached(message).trim(); | |
| if (visibleText) { |
| @@ -1075,6 +1115,11 @@ function renderGroupedMessage( | |||
| }, []) | |||
| .join("\n") | |||
| .trim(); | |||
| // Route through processMessageText so <think>/<final> scaffolding and | |||
| // inbound metadata sentinels are stripped before render. Previously the | |||
| // reduced text was rendered verbatim, leaking <final>…</final> tags and | |||
| // injected "Sender (untrusted metadata):" blocks into the Control UI. | |||
| const extractedText = rawExtractedText ? processMessageText(rawExtractedText, role) : ""; | |||
There was a problem hiding this comment.
renderGroupedMessage still derives its text by joining normalizeMessage(message).content items and then calling processMessageText. Because normalizeMessage expands assistant text blocks and drops textSignature, this path can re-introduce internal assistant scaffolding that extractTextCached intentionally hides (e.g. commentary vs final_answer selection). Consider using extractTextCached(message) as the source for markdownBase (while still using normalizeMessage for attachments/replyTarget) to ensure Control UI text rendering matches the shared assistant-visible-text extraction rules.
| // Per-line system-event prefix (`System:` / `System (untrusted):`) and | ||
| // agent-facing internal instructions must never appear in user-visible | ||
| // chat text. Every continuation line re-applies the prefix upstream, so | ||
| // a simple per-line filter is sufficient and cannot strand stray prose. | ||
| if (!inMetaBlock && (isSystemEventLine(line) || isInternalInstructionLine(line))) { | ||
| continue; | ||
| } |
There was a problem hiding this comment.
stripInboundMetadata now drops any non-meta-block line that begins with System: / System (untrusted): or the internal-instruction prefixes. This will also strip user-authored content that gets rewritten by sanitizeInboundSystemTags() (which intentionally turns a line-leading System: into System (untrusted):), potentially making a legitimate user message render as empty. If the intent is to remove only injected system-event blocks, consider narrowing the match (e.g. only strip these prefixes when they appear in an injected prelude section, or when they match the exact session-system-events formatting) so sanitized-but-user-authored lines aren’t lost.
…ng-only stripper `stripLeadingInboundMetadata` is the variant used by the TUI history formatter at `src/tui/tui-formatters.ts:354` for user-role and command turns. The previous commit extended `stripInboundMetadata` to also drop per-line `System:` / `System (untrusted):` event prefixes and the "An async command you ran earlier has completed." / "Current time: …" internal-instruction leaks, but the TUI leading-only stripper still emitted them verbatim. Apply the same line-anchored filter after the active-memory prompt prefix pass. `SENTINEL_FAST_RE` already includes these patterns, so the fast-path short-circuit keeps its zero-allocation guarantee for clean user text. Whitespace-only prose like "Operating System: Linux" stays intact because `isSystemEventLine` is anchored at the start of the line (not trimmed) and `isInternalInstructionLine` requires a known prefix after trim. When the filter has left leading blank lines in front of non-metadata content, trim them from the no-sentinel return branch as well so a lone `System (untrusted):` line at the start of a TUI message does not leave an empty leading line in the rendered history entry.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ba2f4824f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const lines = stripActiveMemoryPromptPrefixBlocks(text.split("\n")).filter( | ||
| (line) => !isSystemEventLine(line) && !isInternalInstructionLine(line), | ||
| ); |
There was a problem hiding this comment.
Limit line filtering to leading metadata in history stripper
stripLeadingInboundMetadata now filters System:/Current time: instruction prefixes across the entire message before any leading-sentinel scan, so non-metadata content lines with those prefixes are removed even when they are legitimate user or command output text. This function is used by the TUI formatter for user and command turns (src/tui/tui-formatters.ts), so a command transcript that includes lines like System: ... in the body will be silently truncated; the filtering should be constrained to the leading injected metadata region (or to a stricter event signature) instead of global line removal.
Useful? React with 👍 / 👎.
…ata strip
Five review points across Codex, Copilot, and Greptile on the Control UI
cleanup PR and its TUI symmetry follow-up:
1. Narrow System-event line signature (Codex P1, Copilot P1)
The original per-line sweep stripped any line starting with `System:` or
`System (untrusted):`. Two practical problems:
- `sanitizeInboundSystemTags()` deliberately rewrites a user line-leading
`System:` to `System (untrusted):`, so any legitimate user message
whose first line happens to start with `System:` (pasted logs, exec
output, YAML snippets, notes) was getting silently deleted after
sanitization.
- `stripInboundMetadata` is used beyond Control UI rendering
(`command-detection.ts`, `send-policy.ts`, `chat-sanitize.ts`,
`cli-session-history.merge.ts`, `session-cost-usage.ts`), so
over-stripping here corrupts downstream command detection and
session/cost accounting, not just UI.
Tighten `SYSTEM_EVENT_LINE_RE` to require the bracketed timestamp
marker `[Weekday YYYY-MM-DD HH:MM:SS TZ]` that
`session-system-events.ts` always emits on the first sub-line of each
injected event. User-authored `System:` prefixes without the
timestamp signature stay intact. Continuation sub-lines of a single
injected event may still leak, but that is strictly better than
silently deleting real user input.
2. Narrow internal-instruction prefix matches (Codex P1, Copilot P1)
Replaced `INTERNAL_INSTRUCTION_LINE_PREFIXES` with anchored regexes.
- `Current time: ` was too generic — a user note like
"Current time: I'll be free after lunch" matched. Require the
injected shape `Current time: … / YYYY-MM-DD HH:MM UTC` emitted by
`resolveCronStyleNow`.
- `An async command you ran earlier has completed.` kept, since the
full sentence emitted by `heartbeat-events-filter.ts` is long and
specific enough.
3. Constrain stripLeadingInboundMetadata to leading metadata region
(Codex P1 on commit 5ba2f48)
The TUI formatter uses `stripLeadingInboundMetadata` for `user` and
`command` turns. The previous follow-up applied the System/instruction
filter globally, which silently truncated command transcript bodies
containing `System: …` lines. Move the filter into the leading-metadata
skip loop: drop timestamped System-event and injected-instruction lines
only while we are still in the leading prelude (alongside leading blank
lines); the moment we hit the first real user/command content line,
filtering stops. Added tests for mid-body `System:` preservation.
4. Preserve reasoning-only assistant turns (Codex P2)
Routing grouped assistant text through `processMessageText` stripped
`<think>…</think>` scaffolding before the bubble-visibility check, so
an assistant turn that produced only a reasoning block and no visible
final answer was suppressed by the empty-group guard — the reasoning
panel itself disappeared too. Include `reasoningMarkdown` in the
visibility check in `renderGroupedMessage` and also treat reasoning
content as visible in `groupHasVisibleContent`, so reasoning-only
turns still render with the reasoning panel intact.
5. Use extractTextCached + normalize role (Copilot P2 x2, Greptile P2)
- `renderGroupedMessage` and `groupHasVisibleContent` now read visible
text through `extractTextCached(message)` instead of rebuilding it
from `normalizeMessage(...).content`. `normalizeMessage` drops each
block's `textSignature`, so the rebuilt path lost the assistant
phase contract — `final_answer` preference and commentary-only
suppression — and could re-introduce scaffolding that
`extractTextCached` already handles. Routing both surfaces through
the shared extractor also collapses the duplicated precheck work.
- `processMessageText` and `extractText` now consistently normalise
the role to lowercase before dispatching, so a `role: "Assistant"`
message no longer skips the thinking-tag strip path.
New tests cover:
- User-authored `System:` prefix without timestamp stays intact.
- User-authored `Current time: …` prose without the injected UTC suffix
stays intact.
- Mid-body `System: …` line in TUI command transcript is preserved.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e84ec68d6c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // suppress commentary-only blocks) and runs `processMessageText`, so | ||
| // Control UI rendering stays aligned with the other surfaces and cannot | ||
| // re-introduce scaffolding that `normalizeMessage` drops the signature of. | ||
| const extractedText = extractTextCached(message) ?? ""; |
There was a problem hiding this comment.
Keep normalized assistant text path in grouped bubbles
Switching grouped message rendering to extractTextCached(message) bypasses normalizeMessage’s assistant text expansion/cleanup path, so assistant directives like [[reply_to_current]], [[audio_as_voice]], and MEDIA:... can now be rendered verbatim in the bubble while attachments/reply pills are also rendered from normalized content. This regresses prior behavior (clean prose only) and leaks internal scaffolding to end users on assistant turns that include inline media/reply directives.
Useful? React with 👍 / 👎.
| const SYSTEM_EVENT_LINE_RE = | ||
| /^System(?: \(untrusted\))?: \[[A-Z][a-z]{2} \d{4}-\d{2}-\d{2} \d{2}:\d{2}(?::\d{2})?[^\]]*\] /; |
There was a problem hiding this comment.
Strip non-timestamped continuation system-event lines
The new SYSTEM_EVENT_LINE_RE only matches System... lines that contain the bracketed timestamp, but drainFormattedSystemEvents prefixes every subline with System: and adds the timestamp only on subline index 0. For multiline events (for example exec.finished where output is appended on a new line), stripInboundMetadata now removes only the first line and leaves continuation lines like System (untrusted): <output> visible, so system-event leakage still reaches user-facing text as dangling fragments.
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. Reviewed June 14, 2026, 8:46 AM ET / 12:46 UTC. Summary PR surface: Source +119, Tests +125, Docs +4. Total +248 across 6 files. Reproducibility: yes. by source inspection: current main still renders grouped Control UI text from normalized content, lacks group-level empty suppression, and does not strip System/internal-instruction lines in stripInboundMetadata. I did not run a live UI reproduction because this review is read-only and no artifact proof was provided. Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land a refreshed branch that keeps normalized assistant directive/media cleanup, strips full current-main system-event and current-time/internal-instruction shapes without deleting user-authored System text, removes CHANGELOG.md edits, and includes redacted real Control UI/TUI proof. Do we have a high-confidence way to reproduce the issue? Yes by source inspection: current main still renders grouped Control UI text from normalized content, lacks group-level empty suppression, and does not strip System/internal-instruction lines in stripInboundMetadata. I did not run a live UI reproduction because this review is read-only and no artifact proof was provided. Is this the best way to solve the issue? No, not yet. The shared extraction/sanitizer direction is appropriate, but the PR must preserve normalized assistant media/directive cleanup, match current-main injected text shapes, remove release-owned changelog edits, refresh against main, and add real behavior proof. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4644e0c10256. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +119, Tests +125, Docs +4. Total +248 across 6 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Codex review: needs maintainer review before merge. What this changes: The PR exports the chat text post-processor, updates grouped Control UI message rendering to strip assistant/user scaffolding and suppress all-empty groups, extends inbound metadata stripping for system-event/internal-instruction lines including the TUI leading stripper, and adds focused tests plus changelog entries. Maintainer follow-up before merge: This is already an open implementation PR, and the remaining work is a rebase plus maintainer review of sanitizer correctness and grouped-render behavior rather than a separate automated replacement branch. Review detailsBest possible solution: Revise the PR so Control UI grouped bubbles use the shared user/assistant stripping semantics while preserving Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against acae48b790fa. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
This pull request has been automatically marked as stale due to inactivity. |
Summary
Three related bugs where Control UI (and any user-facing surface that shares
stripInboundMetadata) leaks message internals that should already have been stripped:renderGroupedMessagewas extracting text directly fromnormalizedMessage.contentinstead of going throughextractText/processMessageText, so<think>/<final>scaffolding from Gemini-family models and inbound metadata sentinels were rendered verbatim in the chat bubble.stripInboundMetadataonly handled the structured JSON-block sentinels. Per-lineSystem:/System (untrusted):event prefixes emitted bysession-system-events.ts, and the paired "An async command you ran earlier has completed." / "Current time: …" internal agent instructions, still leaked into user-visible text.renderMessageGrouphad no group-level suppression analogous to the per-message check insiderenderGroupedMessage.Changes
ui/src/ui/chat/message-extract.ts: exportprocessMessageTextso other renderers can share the same per-role strip contract.ui/src/ui/chat/grouped-render.ts:renderGroupedMessage's text extraction throughprocessMessageText(assistant →stripThinkingTags, user →stripInboundMetadata(stripEnvelope(...)), other →stripEnvelope).renderMessageGroupso a group whose inner messages all render empty returnsnothinginstead of leaving an orphan avatar/footer behind.src/auto-reply/reply/strip-inbound-meta.ts:SYSTEM_EVENT_LINE_REand anINTERNAL_INSTRUCTION_LINE_PREFIXESlist.SENTINEL_FAST_REto includeSystem:/System (untrusted):and the instruction prefixes so these variants still trigger the slow parse.Test plan
pnpm test ui/src/ui/chat/message-extract.test.ts— newprocessMessageTextsuite covers the empty-<think></think>+<final>variant I actually hit withgemini-3-flash-preview, plus the standard paired shape and plain pass-through for assistant/user roles.pnpm test src/auto-reply/reply/strip-inbound-meta.test.ts— newper-line system events and internal instructionssuite covers consecutiveSystem (untrusted):exec lines, trustedSystem:lines, the async-command / current-time instruction pair, and guards against stripping the inline "Operating System: Linux" prose variant.pnpm tsgo,pnpm check,pnpm check:import-cycles,pnpm check:madge-import-cycles— all green on the PR branch (run viascripts/committerpre-commit).<final>…</final>segments no longer render verbatim,System (untrusted):/ async-command lines no longer surface in user bubbles, and orphan "You · HH:MM" empty groups no longer appear after metadata-only turns. Existing<think>reasoning blocks still surface correctly in the dedicated reasoning panel.No config schema, plugin-SDK surface, or build output shape was changed.