From ebf8443604172feaea773fc3b51f9016a4dda1cf Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Wed, 12 Aug 2026 20:24:30 -0500 Subject: [PATCH 1/2] fix(desktop): paint the self-improvement review row as the memory write it is MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The background review's summary fell through SystemMessage's generic branch: centered, 60% width, muted grey — while the memory tool row it reports on wears the gold-to-purple legendary chrome. Type the event with a review: marker at the gateway handler (same convention as steer: / slash:) and give it the brain glyph, gradient label and purple detail, left-aligned in the reading column. --- .../hooks/use-message-stream/gateway-event.ts | 11 +++++-- .../assistant-ui/thread/system-message.tsx | 31 +++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) 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:(?