mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
Rewinding a desktop session can race with a still-exiting CLI process, leaving late transcript entries after the trim point. Desktop placeholder sessions also need to preserve canonical launch metadata so a zero-message rewind can restart from the real workspace instead of reconstructing it from a lossy sanitized project directory name. Constraint: Rewind must work after trimming back to an empty transcript. Constraint: Session project directory names are sanitized and not reversible. Rejected: Add retries around CLI startup | would leave corrupted transcript state in place. Rejected: Delete desktop placeholder files before first CLI launch | drops the only reliable workDir metadata. Confidence: high Scope-risk: moderate Directive: Do not change rewind process stopping without rechecking late CLI output and transcript metadata preservation. Tested: Real DeepSeek deepseek-v4-pro rewind smoke, bun test src/server/__tests__/sessions.test.ts --timeout 30000, bun test src/server/__tests__/conversations.test.ts --timeout 30000, bun run check:server, bun run check:native, bun run quality:pr, git diff --check Not-tested: Native Windows desktop binary smoke for the original reporter environment.