fix(frontend): export chat handles compacted MESSAGES_SNAPSHOT events#1010
Conversation
When users export a completed session's chat (as Markdown, PDF, or to Google Drive), only the initial prompt is included — the rest of the conversation is missing. This makes the export feature essentially unusable for reviewing or sharing finished sessions. The root cause is that the backend compacts finished sessions by replacing streaming events (TEXT_MESSAGE_*, TOOL_CALL_*) with a single MESSAGES_SNAPSHOT event. The export code only knew how to process streaming events, so all conversation content was silently dropped after compaction. Add blocksFromSnapshot() to extract conversation blocks from MESSAGES_SNAPSHOT messages, including tool calls and results. When a snapshot is present it takes priority over streaming events since it is the canonical source after compaction. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThe changes add support for handling Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…me contributors (#1039) ## Summary - **Group commits by author** with commit counts (e.g., "Gage Krumbach (18)"), sorted by contribution count - **Add "First-Time Contributors" section** with 🎉 emoji to celebrate new contributors - **Use Python** for reliable parsing of commit data with special characters - **Fix `--before` bug**: resolve tag to ISO date since `git log --before` requires a date, not a ref name — passing a tag name silently returns wrong results, causing incorrect first-timer detection ## Example Output (v0.0.34) ### Before (flat list): ``` - fix(frontend): resolve agent response buffering (#991) (de50276) - fix(frontend): export chat handles compacted MESSAGES_SNAPSHOT events (#1010) (b204abd) - fix(frontend): binary file download corruption (#996) (5b584f8) ... ``` ### After (grouped by author): ``` ## 🎉 First-Time Contributors - Derek Higgins - Pete Savage - Rahul Shetty ### Gage Krumbach (5) - fix(runner): improve ACP MCP tools (#1006) (26be0f9) - chore(manifests): scale up frontend replicas (#1008) (b331da1) ... ### Pete Savage (1) - fix(frontend): resolve agent response buffering (#991) (de50276) ``` ## Bug Fix: `--before` with tag names `git log --before=v0.0.33` does **not** filter by the tag's date — it resolves differently and returns commits from after the tag. This caused first-timer detection to produce wrong results. Fixed by resolving the tag to its ISO date first: ```python tag_date = subprocess.run( ['git', 'log', '-1', '--format=%ci', latest_tag], capture_output=True, text=True ).stdout.strip() ``` ## Test Plan - [x] Verified `--before=<tag>` vs `--before=<date>` returns different results - [x] Tested changelog generation locally against v0.0.33→v0.0.34 and v0.0.34→v0.0.35 - [x] Confirmed first-time contributor detection works correctly with date-based filtering - [x] YAML validates (`check-yaml` hook passes) - [ ] Will validate in next production release 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
…ambient-code#1010) When users export a completed session's chat (as Markdown, PDF, or to Google Drive), only the initial prompt is included — the rest of the conversation is missing. This makes the export feature essentially unusable for reviewing or sharing finished sessions. The root cause is that the backend compacts finished sessions by replacing streaming events (TEXT_MESSAGE_*, TOOL_CALL_*) with a single MESSAGES_SNAPSHOT event. The export code only knew how to process streaming events, so all conversation content was silently dropped after compaction. Add blocksFromSnapshot() to extract conversation blocks from MESSAGES_SNAPSHOT messages, including tool calls and results. When a snapshot is present it takes priority over streaming events since it is the canonical source after compaction. -- Done in ambient-code, Needs review (I got no knowledge of this codebase) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…me contributors (ambient-code#1039) ## Summary - **Group commits by author** with commit counts (e.g., "Gage Krumbach (18)"), sorted by contribution count - **Add "First-Time Contributors" section** with 🎉 emoji to celebrate new contributors - **Use Python** for reliable parsing of commit data with special characters - **Fix `--before` bug**: resolve tag to ISO date since `git log --before` requires a date, not a ref name — passing a tag name silently returns wrong results, causing incorrect first-timer detection ## Example Output (v0.0.34) ### Before (flat list): ``` - fix(frontend): resolve agent response buffering (ambient-code#991) (de50276) - fix(frontend): export chat handles compacted MESSAGES_SNAPSHOT events (ambient-code#1010) (b204abd) - fix(frontend): binary file download corruption (ambient-code#996) (5b584f8) ... ``` ### After (grouped by author): ``` ## 🎉 First-Time Contributors - Derek Higgins - Pete Savage - Rahul Shetty ### Gage Krumbach (5) - fix(runner): improve ACP MCP tools (ambient-code#1006) (26be0f9) - chore(manifests): scale up frontend replicas (ambient-code#1008) (b331da1) ... ### Pete Savage (1) - fix(frontend): resolve agent response buffering (ambient-code#991) (de50276) ``` ## Bug Fix: `--before` with tag names `git log --before=v0.0.33` does **not** filter by the tag's date — it resolves differently and returns commits from after the tag. This caused first-timer detection to produce wrong results. Fixed by resolving the tag to its ISO date first: ```python tag_date = subprocess.run( ['git', 'log', '-1', '--format=%ci', latest_tag], capture_output=True, text=True ).stdout.strip() ``` ## Test Plan - [x] Verified `--before=<tag>` vs `--before=<date>` returns different results - [x] Tested changelog generation locally against v0.0.33→v0.0.34 and v0.0.34→v0.0.35 - [x] Confirmed first-time contributor detection works correctly with date-based filtering - [x] YAML validates (`check-yaml` hook passes) - [ ] Will validate in next production release 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
When users export a completed session's chat (as Markdown, PDF, or to Google Drive), only the initial prompt is included — the rest of the conversation is missing. This makes the export feature essentially unusable for reviewing or sharing finished sessions.
The root cause is that the backend compacts finished sessions by replacing streaming events (TEXT_MESSAGE_, TOOL_CALL_) with a single MESSAGES_SNAPSHOT event. The export code only knew how to process streaming events, so all conversation content was silently dropped after compaction.
Add blocksFromSnapshot() to extract conversation blocks from MESSAGES_SNAPSHOT messages, including tool calls and results. When a snapshot is present it takes priority over streaming events since it is the canonical source after compaction.
--
Done in ambient-code, Needs review (I got no knowledge of this codebase)