Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

test(desktop): cover legacy transcript replay edges

open
Stack 2/2
#401 opened by cursor[bot]cursor/regression-test-coverage-ab62→main
Conversation0
cursor[bot]
Commits
0
Files changed…
opened this pull request
Author
· 20 hours ago

Risky behavior now covered

Legacy TypeScript-harness transcript replay (store.legacyTranscript.ts), which hydrates old local chats after the Rust server stopped emitting assistant_message, reasoning, and model_stream_chunk events:

  • A later turn that reuses a tool-call id does not overwrite the earlier tool card or its streamed reply, and a user message starts a fresh reply so the same assistant text is shown again.
  • Partial tool-argument JSON is kept (cwd plus the raw fragment), tool_input_end promotes and renames the card, a bare end does not invent a tool, numeric ids match across start and tool_error, and denial without a reason does not invent a result.
  • A final assistant reply is dropped only when it repeats streamed text (including a prefix of the aggregate and whitespace-only text). Commentary text does not suppress the assistant reply. 0 is kept.
  • Whitespace-equivalent streamed reasoning is dropped. An unstreamed reasoning_summary and assistant_reasoning are inserted before the first streamed assistant reply.
  • session_busy: true does not clear the stream, so the duplicate final reply stays hidden. session_busy: false does, so the final reply is shown again.
  • Citations attach only to the assistant stream that text_end closes: index fallback, unknown ids, empty annotation lists, commentary ends, and a later turn that reuses the stream id.

Test files added/updated

  • Updated apps/desktop/test/store-feed-mapping.transcript.test.ts

Why these tests materially reduce regression risk

The decoder landed in #393 and was patched twice on 2026-11-11 (citation text_end chunks, streamed tool_input_delta args). Those fixes only locked the happy path. A reset, dedup, or annotation miss renders old threads with the wrong command, a dropped answer, a duplicated reply, or a citation on the wrong message, and that replay is what buildContextPreamble() feeds back into the model.

No production code changed.

Validation

bun scripts/run_tests.ts apps/desktop/test/store-feed-mapping.transcript.test.ts — 18 pass, 0 fail. Biome check on the file is clean. Full suite was not re-run.

Open in Web View Automation 
This branch can’t be merged automatically yet
Branch comparison failed — verify branches still exist in storage.
0 approving reviews
None yet
Checks
No checks recorded
Fast-forward
Source must contain the target branch tip
main ← cursor/regression-test-coverage-ab62

Sign in to comment.

Stack

2/2
1

Merge readiness

Checking mergeability after the indexing worker computes the current branch state.

Autopilot

Debug

Reviews

Approved0
ReviewersNone yet

Configure an OpenRouter key in repository settings.

Update README.md

#125 mobile-fixes ← main

Updated 5 months ago

merged
2

test(desktop): cover legacy transcript replay edges

#401 main ← cursor/regression-test-coverage-ab62

Updated 20 hours ago

open