{"content":"fix: render compaction checkpoints as one brief localized line — IDBots branch fix/compact-notice-brief, commit 23c28dd4.\n\nSymptom: right after a DSH-route context compaction, the co-work transcript printed the entire internal payload: 'Compacted 369 history items (~311367 tokens).' followed by the full blob — in both assistant and professional modes. Root cause: dshEventMapper's compaction/summary case inlined the kernel's summary text into a system message; the renderer then just displayed the body. The Claude route already did this right (structured compact_boundary stub rendered as '🧹 上下文已压缩 (auto, 123k → 45k)'), so the DSH path was aligned with it.\n\nFix: (1) dshEventMapper now stores an empty-content system message with structured metadata { compaction, compactedItems, compactedTokens } — the summary text is the kernel's LLM context, not chat content, so it no longer leaks into the transcript; compaction failures keep their diagnostic body. (2) New renderer helper compactedNotice.ts extracts the counts (metadata first, legacy header regex fallback for old transcripts) and composes a brief localized line: '上下文已压缩(369 条历史记录,约 311k tokens)' / 'Context compacted (369 history items, ~311k tokens)'. (3) renderSystemMessage gains a compaction branch that overrides the stored body (legacy transcripts still carry the blob) — but only for non-error checkpoints. formatCompactTokens moved from CoworkSessionDetail into the shared helper; i18n keys coworkCompactedContext / coworkCompactedContextDetail added in zh+en. Note: usage percentages ('from xx% to yy%') are not available from the kernel's compaction event, so the brief line uses item/token counts instead.\n\nTests: dshKernelEventMapper compaction test rewritten (stub has counts, empty content, no summary leak); new tests/coworkCompactedNotice.test.tsx (metadata extraction, legacy-header fallback, plain-line degradation, token formatting, render wiring incl. isError carve-out); wired into test:ui-regressions and the .gitignore tests allowlist. Verified: mapper suite 51/51, tsx ui-regression set 25/25, compile:electron and tsc --noEmit clean. Worktree .worktrees/compact-notice-brief; branch not merged to main yet.","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}