mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
Session titles need to appear immediately, but the async AI title pass can return fenced or escaped JSON fragments. Keep the first-message title path fast, preserve optimistic client titles during background refresh, and only accept structured title responses that parse cleanly. Constraint: Desktop sessions should stop showing Untitled/New Session after the first user turn. Rejected: Accept short raw model output as a fallback | malformed JSON fragments are short enough to leak into the UI. Confidence: high Scope-risk: moderate Directive: Do not loosen generated title parsing without regression coverage for fenced, escaped, and truncated JSON responses. Tested: bun test src/server/__tests__/title-service.test.ts Tested: bun run check:server Tested: cd desktop && bun run test -- --run src/stores/chatStore.test.ts src/stores/sessionStore.test.ts src/pages/EmptySession.test.tsx Tested: agent-browser smoke on http://127.0.0.1:1420/ confirmed sidebar and tab titles update without JSON fragments.