Skip to content

fix: drain Codex SessionStart stdin#635

Open
chief-impact7 wants to merge 1 commit into
DietrichGebert:mainfrom
chief-impact7:fix/drain-session-start-stdin
Open

fix: drain Codex SessionStart stdin#635
chief-impact7 wants to merge 1 commit into
DietrichGebert:mainfrom
chief-impact7:fix/drain-session-start-stdin

Conversation

@chief-impact7

Copy link
Copy Markdown

Summary

  • keep the SessionStart hook alive while Codex finishes writing stdin
  • discard unused input instead of closing the pipe early
  • retain the existing 1-second fallback so Windows wrappers cannot freeze the session

Why

Codex can write a large SessionStart payload after this hook has already emitted its output. Exiting immediately closes the read end and makes Codex report failed to write hook stdin: Broken pipe (os error 32).

Tests

  • node --test tests/hooks.test.js tests/hooks-windows.test.js (8/8 passed)
  • node --check hooks/ponytail-activate.js
  • full root suite: 83/84 passed; the unrelated pandas correctness benchmark exceeded its existing 1-second subprocess timeout

Constraint: Windows wrappers may leave stdin open indefinitely
Rejected: Wait unbounded for EOF | freezes Windows sessions
Confidence: high
Scope-risk: narrow
Directive: Stdin-independent hooks must drain with a bounded self-exit fallback
Tested: node --test tests/hooks.test.js tests/hooks-windows.test.js
Not-tested: pandas correctness benchmark is independently failing its 1s subprocess timeout
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