Skip to content

fix(terminal): prevent Herdr rendering freezes - #2472

Merged
binaricat merged 10 commits into
mainfrom
codex/fix-herdr-xterm-freeze
Jul 25, 2026
Merged

binaricat merged 10 commits into
mainfrom
codex/fix-herdr-xterm-freeze

Conversation

@binaricat

@binaricat binaricat commented Jul 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • keep xterm writes on the normal asynchronous completion path so full-screen Herdr frames cannot strand the renderer acknowledgement queue
  • drain pending output safely before resize, hibernate, snapshots, close, and attach handoff
  • coordinate output pauses across main and popup windows, including worker mode and crash recovery
  • retain the WebGL atlas-capacity recovery for the separate long-running renderer freeze
  • add regressions for Herdr-style frames in visible, hidden, reveal, resize, handoff, and worker scenarios

Root cause

There were two independent freeze modes.

The immediate, consistently reproducible stall was caused by Netcatty forcing xterm private synchronous parser drains while a normal asynchronous write was active. xterm documents that path as unreliable. It could strand the queued completion callback, so Netcatty never acknowledged the large frame and the backend stayed paused after the first partial render.

A separate long-running WebGL issue could exhaust the renderer atlas capacity during sustained glyph churn. This remains covered by the reviewed xterm backport and a real Electron pixel-level regression test.

Validation

  • local Codex CLI review on the final head: no actionable regressions
  • two independent review agents: CLEAN
  • Herdr focused regression repeated 10/10 on the final test fix
  • terminal-focused tests: 129/129 passed
  • main-process and worker flow tests: 72/72 passed
  • WebGL patch tests: 7/7 passed
  • real Electron/WebGL overflow regression: passed
  • current-head GitHub lint-and-test: passed
  • npm run lint
  • npm run build
  • git diff --check
  • restarted the current worktree with npm run dev for manual Herdr verification

Closes #2455

@binaricat binaricat added the automation:codex-loop Own/bot PR waiting on Codex review↔fix loop label Jul 24, 2026
@binaricat

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: bf58324c80

ℹ️ 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".

@netcatty-bot
netcatty-bot marked this pull request as ready for review July 24, 2026 15:29

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf58324c80

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/patch-xterm-webgl-atlas.cjs Resolved
@binaricat
binaricat force-pushed the codex/fix-herdr-xterm-freeze branch from bf58324 to defbb95 Compare July 24, 2026 15:46
@binaricat
binaricat marked this pull request as draft July 24, 2026 15:46
@binaricat
binaricat marked this pull request as ready for review July 24, 2026 15:49
@binaricat

Copy link
Copy Markdown
Owner Author

@codex review

@binaricat
binaricat marked this pull request as draft July 24, 2026 15:54
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: defbb95e16

ℹ️ 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".

@binaricat

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: b1a6e28975

ℹ️ 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".

@netcatty-bot
netcatty-bot marked this pull request as ready for review July 24, 2026 16:56
@binaricat
binaricat marked this pull request as draft July 24, 2026 18:03
@binaricat binaricat changed the title fix(terminal): prevent Herdr rendering freeze fix(terminal): prevent Herdr rendering freezes Jul 24, 2026
@binaricat

Copy link
Copy Markdown
Owner Author

@codex review

@binaricat

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ 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".

@binaricat

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4f67c43e4a

ℹ️ 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".

@netcatty-bot netcatty-bot added ready-for-human Requires human implementation and removed automation:codex-loop Own/bot PR waiting on Codex review↔fix loop labels Jul 24, 2026
@netcatty-bot

Copy link
Copy Markdown
Collaborator

Codex only reported P3 nitpicks (no P0–P2). Automatic fix stopped; a maintainer can decide whether to polish further.

@binaricat

Copy link
Copy Markdown
Owner Author

@codex review

@binaricat binaricat added the automation:codex-loop Own/bot PR waiting on Codex review↔fix loop label Jul 24, 2026
@binaricat

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 54e1ab1fac

ℹ️ 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".

@netcatty-bot
netcatty-bot marked this pull request as ready for review July 24, 2026 18:24
@binaricat
binaricat merged commit 093c997 into main Jul 25, 2026
55 of 57 checks passed
@binaricat
binaricat deleted the codex/fix-herdr-xterm-freeze branch July 27, 2026 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation:codex-loop Own/bot PR waiting on Codex review↔fix loop ready-for-human Requires human implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] herdr 使用一段时间后,herdr页面完全卡住无法点击了

2 participants