程序员阿江(Relakkes) 7fbce35be6 fix: prevent malformed generated session titles
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.
2026-05-07 16:28:08 +08:00
..
2026-05-04 16:45:24 +08:00
2026-05-04 16:45:24 +08:00
2026-05-04 17:57:03 +08:00
2026-04-18 20:34:56 +08:00
2026-03-31 01:55:58 -07:00
2026-04-18 20:34:56 +08:00
2026-04-18 20:34:56 +08:00
2026-03-31 01:55:58 -07:00
2026-03-31 01:55:58 -07:00
2026-03-31 01:55:58 -07:00
2026-04-03 00:30:56 +08:00
2026-03-31 01:55:58 -07:00
2026-03-31 01:55:58 -07:00
2026-03-31 01:55:58 -07:00
2026-03-31 01:55:58 -07:00
2026-03-31 01:55:58 -07:00
2026-03-31 01:55:58 -07:00
2026-03-31 01:55:58 -07:00