diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event.ts b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event.ts index ee13f48521963..a5875b81c455d 100644 --- a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event.ts +++ b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event.ts @@ -1184,7 +1184,14 @@ export function useGatewayEventHandler(deps: GatewayEventDeps) { // change happens silently. Surface it as a persistent system message // in the transcript so the user is always informed — it must not be a // transient toast that can be missed. - const text = coerceGatewayText(payload?.text).trim() + // + // Typed here with the `review:` marker (same convention as `steer:` / + // `slash:`) so SystemMessage can paint it as the memory-write row it + // is instead of sniffing the backend's prose. The leading 💾 goes with + // it — the row draws its own glyph. + const text = coerceGatewayText(payload?.text) + .trim() + .replace(/^[^\p{L}\p{N}]+/u, '') if (text && sessionId) { flushQueuedDeltas(sessionId) @@ -1195,7 +1202,7 @@ export function useGatewayEventHandler(deps: GatewayEventDeps) { { id: `review-summary-${Date.now()}`, role: 'system', - parts: [textPart(text)], + parts: [textPart(`review:${text}`)], timestamp: Math.floor(Date.now() / 1000) } ] diff --git a/apps/desktop/src/components/assistant-ui/thread/system-message.tsx b/apps/desktop/src/components/assistant-ui/thread/system-message.tsx index 57631764f8faa..2a8e7b17fe83c 100644 --- a/apps/desktop/src/components/assistant-ui/thread/system-message.tsx +++ b/apps/desktop/src/components/assistant-ui/thread/system-message.tsx @@ -2,12 +2,15 @@ import { MessagePrimitive, useAuiState } from '@assistant-ui/react' import { type FC } from 'react' import { messageContentText } from '@/components/assistant-ui/thread/content' +import { SCAFFOLD_LABEL_CLASS } from '@/components/chat/scaffold-row' import { Codicon } from '@/components/ui/codicon' +import { ToolIcon } from '@/components/ui/tool-icon' import { LinkifiedText } from '@/lib/external-link' import { cn } from '@/lib/utils' const SLASH_STATUS_RE = /^slash:(?\/[^\n]+)\n(?[\s\S]*)$/ const STEER_NOTE_RE = /^steer:(?[\s\S]+)$/ +const REVIEW_NOTE_RE = /^review:(?