fix: treat omitted autoResolutionMs as no auto-resolution - #408
Open
2409324124 wants to merge 1 commit into
Open
fix: treat omitted autoResolutionMs as no auto-resolution#4082409324124 wants to merge 1 commit into
2409324124 wants to merge 1 commit into
Conversation
2409324124
marked this pull request as ready for review
August 17, 2026 17:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #344.
request_user_inputwas aborted immediately with{answers:{}}whenautoResolutionMsis omitted, before the client could render the form.requestUserInputElicitation: the blocking path was gated onparams.autoResolutionMs === null. When Codex omits the field it arrives asundefined, so the code fell through to the timeout path whereundefined ?? 0schedules an immediateresolveWithoutInput; the abort winsPromise.raceon the next tick.nullandundefinedas "no auto-resolution" via== null. Explicit numericautoResolutionMstimeout behavior is unchanged.Tests
src/__tests__/CodexACPAgent/elicitation-events.test.ts: withautoResolutionMsomitted and a client answer arriving after 200ms, the handler must wait for the client instead of aborting. On the current code it returns{answers:{}}in ~11ms; with the fix it waits ~200ms and returns the client's answers.npm test(435 passed, 28 skipped)npm run typecheckNote on e2e coverage
This is not covered by an e2e test.
request_user_inputis emitted by a real Codex session during interactive flows, so deterministically reproducing the omitted-field case requires injecting the protocol message rather than driving a live model (which would also needOPENAI_API_KEY). The mock-fixture unit test above does exactly that, matching the runtime shape Codex actually sends.