[codex] Fix Codex resize output holds#305
Conversation
Keep rendering the Architect scene while a resized or synchronized session is settling. Reuse that session's previous texture until repaint output goes quiet, with a hard timeout for stuck sessions.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 299f31b734
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR changes Architect’s resize/synchronized-output rendering behavior from a global present freeze to a per-session hold that reuses cached terminal textures while a session’s repaint settles. It fits into the rendering/runtime pipeline by coordinating session state tracking, render-cache reuse, and layout-driven resize handling.
Changes:
- Added per-session tracking for synchronized-output quiet windows and a new terminal-resize hold window.
- Updated the renderer to reuse cached session textures during active output holds instead of blocking the whole frame.
- Wired the runtime/layout paths to start, expire, and document the new hold behavior, with targeted unit tests.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/session/state.zig |
Adds session-level timers/state for synchronized-output and terminal-resize holds, plus related expiry logic and tests. |
src/render/renderer.zig |
Reuses cached textures while a session is under an output hold and adds a helper/test for the hold predicate. |
src/app/runtime.zig |
Treats visible output holds as active-frame pacing signals and expires the new resize hold during the frame loop. |
src/app/layout.zig |
Starts the new resize hold when terminal cell dimensions change during layout application. |
docs/ARCHITECTURE.md |
Updates architecture notes to describe the new per-session hold/rendering behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What changed
This keeps Architect rendering while a terminal session is settling after a resize or while it is in DEC synchronized output mode.
Instead of blocking the whole frame present path, the renderer now reuses the affected session's last texture until that session's repaint output goes quiet. There is still a hard timeout for stuck sessions.
Why
PR #303 held rendering globally while any visible session had mode 2026 set. Codex uses mode 2026 heavily during resize repaints, and its repaint can outlive the previous 1000 ms fallback. That produced a whole-window freeze followed by the same top-to-bottom repaint the hold was meant to hide.
New-session grid resizes also had a short unbracketed repaint window before Codex entered mode 2026, so this adds a terminal-resize settle hold too.
Validation
nix develop -c zig build test --summary allnix develop -c zig build --summary allnix develop -c just lintManual check still needed in the app: Codex grid/full toggle, Codex resize via new-session creation, and Claude grid/full toggle.