Skip to content

fix: settle login close when children ignore SIGTERM or hold pipes - #142

Closed
mangeshraut712 wants to merge 1 commit into
openai:mainfrom
mangeshraut712:fix/login-close-hang-ci
Closed

fix: settle login close when children ignore SIGTERM or hold pipes#142
mangeshraut712 wants to merge 1 commit into
openai:mainfrom
mangeshraut712:fix/login-close-hang-ci

Conversation

@mangeshraut712

@mangeshraut712 mangeshraut712 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixes the flaky node-ci hang on main where CodexSecurity orchestration > keeps ambient credentials available after successful ChatGPT login timed out and left orphaned bun/node processes (example).
  • Addresses SDK close can hang indefinitely when a login child ignores SIGTERM #131: after SIGTERM, escalate to SIGKILL and destroy stdio so login.wait() / close() always settle.
  • Enable the exit→destroy-pipes fallback on all platforms (previously Windows-only).
  • Harden the ambient ChatGPT login fixture to exit after printing the auth URL.
  • Pin GitHub Actions dependencies maintained in this repo: actions/checkout → v7.0.1, actions/setup-node → v7.0.0.

Test plan

  • bun test ./tests-ts/auth.test.ts (includes new SIGTERM-ignore + cross-platform pipe fallback)
  • Focused API login/close cases including the previously hanging ambient-credentials test
  • bun test ./tests-ts/cli.test.ts
  • GitHub Actions node-ci / container-ci on this PR

@chatgpt-codex-connector

Copy link
Copy Markdown

Note

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

CodexLoginHandle waited only on child "close", which hung when the
process ignored SIGTERM or kept stdio pipes open. Add a cross-platform
exit-then-destroy-stdio fallback and escalate cancel with SIGKILL after
SIGTERM so CI login teardown cannot stall indefinitely.

Addresses #131
@mangeshraut712
mangeshraut712 force-pushed the fix/login-close-hang-ci branch from 04bacf2 to 5ab7dca Compare July 30, 2026 17:21
@mldangelo-oai

Copy link
Copy Markdown
Collaborator

Thank you for looking into login processes that do not exit cleanly. The shutdown fix has already landed on main, and this branch also includes workflow updates that are unrelated to that issue. I'm going to close it rather than merge the extra changes. We'd welcome another focused contribution.

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