Skip to content

fix(terminal): release hidden ended sessions - #2582

Merged
binaricat merged 10 commits into
mainfrom
codex/issue-2578-terminal-lag
Jul 29, 2026
Merged

binaricat merged 10 commits into
mainfrom
codex/issue-2578-terminal-lag

Conversation

@binaricat

@binaricat binaricat commented Jul 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Release the full terminal runtime when a hidden remote session has already ended, so disconnected tabs no longer retain their complete xterm resources indefinitely.
  • Preserve final output when a session ends during hibernation, and keep the terminal drawable if the user returns while that work is being cancelled.
  • Preserve connected-session handoff, inline images, full-screen terminal apps, and offline wake/reconnect behavior.
  • Repair the live terminal performance step added by fix(terminal): speed up dense keyword highlighting #2581 so it runs reliably on GitHub-hosted Linux runners.
  • Record the new [Bug] 开5个左右workspace,每个space开3个左右terminal,长时间运行卡顿 #2578 evidence and the remaining diagnostic boundary.

This is a narrow follow-up. It addresses the newly reported "ended sessions left open overnight" path, but does not claim to resolve the original reporter's still-connected 5×3 terminal scenario or close #2578.

Type of Change

  • Bug fix
  • New feature
  • Refactor / code cleanup
  • Documentation update
  • Build / CI change
  • Other (please describe):

Related Issue (optional)

Related to #2578. Follow-up to #2581.

Changes Made

  • Allow hidden disconnected remote terminals to enter full hibernation after their backend session ID has been cleared.
  • Upgrade already soft-hidden ended sessions to full hibernation, including sessions that ended in an alternate-screen app.
  • Abort an in-flight connected snapshot when the backend ends, so the disconnected retry can include the final output.
  • Keep reconnect preparation protected until queued terminal reset work has actually handed off to the new session.
  • Resume a soft-hidden renderer before an asynchronous full-hibernate upgrade and restore it if the upgrade is cancelled.
  • Preserve the soft-hide-only path for terminals holding inline images.
  • Add regression coverage for lifecycle changes, reconnect races, soft-hidden upgrades, alternate-screen sessions, inline images, and CI workflow structure.
  • Run the Xvfb Electron performance check with the Linux sandbox override and a mapped test window, matching Electron page-visibility behavior under CI.

Screenshots / Demo

No UI changes. The behavior change occurs after an ended remote terminal is hidden while hidden-tab hibernation is enabled.

Testing

  • I have tested these changes locally (npm run dev)
  • Linting passes (npm run lint; one pre-existing warning remains in App.tsx)
  • Tests pass (npm test: 8,228 total, 8,218 passed, 10 skipped, 0 failed)
  • Generated capability tool specs are updated when applicable (not applicable; no catalog changes)
  • No new console errors or warnings, if this affects app behavior

Additional verification:

  • Focused hibernate, inline-image, and workflow suite: 47 passed.
  • Live Electron decoration test: passed with the same Linux CI settings.
  • Production build: passed.
  • Latest pushed head: 7bae1c9b0b30524acf5746e9e64a66a98f20a024.

Checklist

  • My code follows the existing project style
  • I have added or updated relevant documentation
  • I have not introduced any breaking changes (or I have described them above)

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

Copy link
Copy Markdown
Owner Author

@codex review

@binaricat
binaricat marked this pull request as draft July 29, 2026 05:52

@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: f222d2a5a7

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

Comment thread components/Terminal.tsx Outdated
@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: 28531b8f90

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

Comment thread components/Terminal.tsx Outdated
@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: 5066cd134e

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

Comment thread components/Terminal.tsx
@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: a4935b26e7

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

Comment thread components/Terminal.tsx
Comment thread components/Terminal.tsx
@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: 79a9cfec92

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

Comment thread components/Terminal.tsx Outdated
Comment thread components/Terminal.tsx Outdated
@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: 2f321d580c

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

Comment thread docs/research/terminal-lag-issues-2578-2251.md Outdated
@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: 7bae1c9b0b

ℹ️ 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 29, 2026 07:09
@netcatty-bot netcatty-bot added automation:bot-pr PR created or owned by Cursor automation automation:codex-clean Last Codex review reported clean and removed automation:codex-loop Own/bot PR waiting on Codex review↔fix loop labels Jul 29, 2026
@netcatty-bot

Copy link
Copy Markdown
Collaborator

Codex reported no major issues. This PR is marked ready for human review/merge.

1 similar comment
@netcatty-bot

Copy link
Copy Markdown
Collaborator

Codex reported no major issues. This PR is marked ready for human review/merge.

@binaricat
binaricat merged commit db236c8 into main Jul 29, 2026
14 checks passed
@binaricat
binaricat deleted the codex/issue-2578-terminal-lag branch July 31, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation:bot-pr PR created or owned by Cursor automation automation:codex-clean Last Codex review reported clean

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 开5个左右workspace,每个space开3个左右terminal,长时间运行卡顿

2 participants