mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
Desktop session interruptions were leaving two different classes of stale UI artifacts behind: reconnects could silently lose in-flight output, and history reloads could replay synthetic interruption or internal command breadcrumbs as if they were user-facing transcript content. This change rebinds active session output to the latest client websocket on reconnect, preserves queued outbound messages across transient disconnects, and filters synthetic transcript entries before they reach the desktop history API so reloads reconstruct only the messages users should actually see. Constraint: Desktop transcript history is shared with CLI JSONL files and must stay compatible with persisted message shapes Rejected: Hide these artifacts only in React renderers | other transcript consumers would still receive polluted history Confidence: high Scope-risk: moderate Reversibility: clean Directive: Keep transcript filtering aligned with real synthetic/internal message shapes before adding new hidden message types Tested: bun test src/server/__tests__/sessions.test.ts Tested: bun test src/server/__tests__/conversations.test.ts Tested: cd /Users/nanmi/.codex/worktrees/e7ac/claude-code-haha/desktop && bun run test -- websocket.test.ts Tested: cd /Users/nanmi/.codex/worktrees/e7ac/claude-code-haha/desktop && bun run lint Not-tested: Manual browser verification of the refreshed session transcript after interrupt on this exact session