Skip to content

fix(reader): keep reader mode snapshot stable - #405

Merged
forketyfork merged 1 commit into
mainfrom
fix/reader-mode-snapshot
Sep 11, 2026
Merged

fix(reader): keep reader mode snapshot stable#405
forketyfork merged 1 commit into
mainfrom
fix/reader-mode-snapshot

Conversation

@forketyfork

Copy link
Copy Markdown
Owner

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

  • Open Reader Mode on a session that is actively producing output and confirm the displayed content remains stable while the terminal updates.
  • Close and reopen Reader Mode and confirm the newly produced output is captured.

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.
@forketyfork
forketyfork marked this pull request as ready for review September 11, 2026 11:34
@forketyfork
forketyfork requested a balanced review from Copilot September 11, 2026 11:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.

@forketyfork
forketyfork merged commit ef552da into main Sep 11, 2026
5 checks passed
@forketyfork
forketyfork deleted the fix/reader-mode-snapshot branch September 11, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants