Skip to content

fix: treat omitted autoResolutionMs as no auto-resolution - #408

Open
2409324124 wants to merge 1 commit into
agentclientprotocol:mainfrom
2409324124:fix/request-user-input-auto-resolution-null-check
Open

fix: treat omitted autoResolutionMs as no auto-resolution#408
2409324124 wants to merge 1 commit into
agentclientprotocol:mainfrom
2409324124:fix/request-user-input-auto-resolution-null-check

Conversation

@2409324124

@2409324124 2409324124 commented Aug 17, 2026

Copy link
Copy Markdown

Summary

Fixes #344.

  • request_user_input was aborted immediately with {answers:{}} when autoResolutionMs is omitted, before the client could render the form.
  • Root cause in requestUserInputElicitation: the blocking path was gated on params.autoResolutionMs === null. When Codex omits the field it arrives as undefined, so the code fell through to the timeout path where undefined ?? 0 schedules an immediate resolveWithoutInput; the abort wins Promise.race on the next tick.
  • Change: treat both null and undefined as "no auto-resolution" via == null. Explicit numeric autoResolutionMs timeout behavior is unchanged.

Tests

  • Added a regression test in src/__tests__/CodexACPAgent/elicitation-events.test.ts: with autoResolutionMs omitted 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 typecheck

Note on e2e coverage

This is not covered by an e2e test. request_user_input is 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 need OPENAI_API_KEY). The mock-fixture unit test above does exactly that, matching the runtime shape Codex actually sends.

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.

request_user_input is aborted immediately when autoResolutionMs is omitted

1 participant