Skip to content

[codex] prevent chatgpt read from hanging in TTY output#1698

Draft
vtxyer wants to merge 1 commit into
jackwener:mainfrom
vtxyer:codex/fix-chatgpt-read-tty-hang
Draft

[codex] prevent chatgpt read from hanging in TTY output#1698
vtxyer wants to merge 1 commit into
jackwener:mainfrom
vtxyer:codex/fix-chatgpt-read-tty-hang

Conversation

@vtxyer
Copy link
Copy Markdown

@vtxyer vtxyer commented May 21, 2026

Summary

  • avoid default TTY table rendering for long/multiline cells so ChatGPT replies do not spin inside cli-table wrapping
  • add chatgpt read limit/max-chars/timeout options while preserving full-output defaults
  • make Browser Bridge close-window cleanup short and non-retrying
  • clarify chatgpt read empty results when the session is on the ChatGPT home page instead of a conversation

Root Cause

opencli chatgpt read could complete the browser read but hang before returning in an interactive terminal because the default table renderer tried to word-wrap a long CJK multiline Text cell. Sampling the stuck process showed CPU in JS string/regex replacement inside table wrapping while the daemon had pending: 0.

Validation

  • npm run build-manifest
  • script -q /tmp/opencli-commit-tty-read.log opencli chatgpt read
  • time opencli chatgpt read >/tmp/opencli-commit-read.out
  • git diff --cached --check

Vitest was not runnable in this checkout because the local Vite/Vitest install fails during startup with ERR_PACKAGE_PATH_NOT_EXPORTED: Package subpath ./module-runner is not defined by "exports".

Avoid the default TTY table renderer for long or multi-line cells, which can spin inside cli-table wrapping for ChatGPT replies. Add read bounds/options, clearer empty-page hints, and keep browser close-window cleanup best-effort so command exit cannot stall.
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.

1 participant