Repository navigation
fix(codex): exit diagnostics wait for stderr after a failed write #30995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -100,9 +100,14 @@ export const makeStderrTail = Effect.fn("makeStderrTail")(function* ( | |
| Effect.ignore, | ||
| Effect.forkScoped, | ||
| ); | ||
| // One bounded wait shared by every caller, so a later read never adds a second delay. | ||
| const awaitDrained = yield* Effect.cached( | ||
| Fiber.join(drain).pipe(Effect.timeout("250 millis"), Effect.ignore), | ||
| ); | ||
| return { | ||
| read: Ref.get(tail), | ||
| awaitDrained: Fiber.join(drain).pipe(Effect.timeout("250 millis"), Effect.ignore), | ||
| // The exit status can arrive before stderr finishes, so a read waits for the drain. | ||
| read: Effect.andThen(awaitDrained, Ref.get(tail)), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preserve an observed exit status when stderr drains slowly. The protocol's Separate the exit-status deadline from the stderr-drain deadline. Preserve bounded failure when the process stays alive. Add this write-failure ordering to the existing integration coverage.
|
||
| awaitDrained, | ||
| }; | ||
| }); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing
names the stderr error line when the process exitscase already checks successfulmakeTerminationErrorclassification and stderr/message propagation. Replace its immediate-string fixture with this exit-gatedmakeStderrTailfixture and retain its assertions, so it also covers stderr arriving after the exit status without adding a second overlappingit. The repository's test rules require extending a fitting case before adding one.AGENTS.md reference: AGENTS.md:L107-L107
Useful? React with 👍 / 👎.