fix(reader): keep reader mode snapshot stable - #405
Merged
Conversation
Issue: Cmd+R could freeze Architect when Reader Mode opened on a live Codex session because terminal history was reparsed on every render epoch update. Solution: Load terminal history only when Reader Mode opens and keep that content stable while terminal output continues. Add regression coverage and document that closing and reopening captures newer output.
There was a problem hiding this comment.
🟢 Approval recommended
The focused change removes repeated reparsing, preserves reopen refresh behavior, and includes appropriate regression coverage and documentation.
Pull request overview
Stabilizes Reader Mode by retaining an open-time terminal-history snapshot instead of reparsing live output.
Changes:
- Removes render-epoch-driven refreshes.
- Adds regression coverage and test registration.
- Updates user and architecture documentation.
File summaries
| File | Description |
|---|---|
src/ui/components/reader_overlay.zig |
Implements snapshot behavior and regression test. |
src/main.zig |
Registers Reader Mode tests. |
README.md |
Documents snapshot semantics. |
docs/ARCHITECTURE.md |
Updates Reader Mode architecture documentation. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Opening Reader Mode with Cmd+R on a live Codex session could freeze Architect because the reader reparsed terminal history whenever the terminal render epoch changed.
Solution
Reader Mode now loads terminal history only when the overlay opens and keeps that content as a snapshot while the terminal continues updating. Closing and reopening the overlay captures newer output. A regression test verifies that terminal epoch changes do not replace the current snapshot.
Context
The macOS hang report showed the main thread spending the sampled interval in the Reader Mode rendering path while a live agent was producing terminal output. This change removes the reader's direct dependency on terminal refresh epochs.
Test plan