Repository navigation
feat: carry async questions from upstream #707 - #20
Merged
Merged
Conversation
…#707) ## Problem Codex's `request_user_input_async` tool asks questions without waiting: it emits an `agentMessage` with `delivery: "async"` and `questions`, and the turn continues. The adapter dropped these messages, so Air showed nothing and the agent went on with its defaults (IJAI-4999). ## Fix - Show agent messages that arrive whole, without deltas, so the question text appears live. - Send async questions as a non-blocking form elicitation. On ACP v2 the session state stays `running` while the form is open. - Steer an accepted answer into the turn that asked, in the reply envelope Codex clients use. Declining or cancelling sends nothing. - Cancel open elicitations with `$/cancel_request` when their turn ends, the session closes or the app-server is lost. - Drop an answer that arrives after its turn ended, as the Codex TUI does, and send a warning notice where the client supports notices. - On replay, show a stored answer as the quoted question followed by the answer, instead of the raw envelope. Behaviour is documented in `docs/async-questions.md`. Tests cover ACP v1 and v2. Carried from upstream agentclientprotocol#707. (cherry picked from commit cc57c7e)
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.
Carries upstream agentclientprotocol#707 (async questions) ahead of the next stable release.
What is carried
e57bcd7feat: show async Codex questions as elicitations (feat: show async Codex questions as elicitations agentclientprotocol/codex-acp#707). A clean cherry-pick of the upstream squash commitcc57c7e, whose parent is exactlyv2.5.0. Original author kept, diff identical to upstream. No prerequisite commit is needed: the v2.5.0 generatedThreadItemalready hasdeliveryandquestions, and feat: show async Codex questions as elicitations agentclientprotocol/codex-acp#707 lands before the SDK 2.2 bump (fix: update ACP SDK to 2.2 and align protocol behavior agentclientprotocol/codex-acp#710).fa90731chore: records it in the downstream patch ledger asasync-questions(upstream PR 707,disposition: active), adds it toKNOWN_PATCH_IDENTITIES, and mentions it indocs/ALAS_DOWNSTREAM.md. The next stable sync that contains feat: show async Codex questions as elicitations agentclientprotocol/codex-acp#707 will classify it as absorbed, and it is dropped then.Behaviour (see
docs/async-questions.md):request_user_input_asyncquestions become a non-blocking formelicitation/createwith_meta.codex.delivery: "async"(only when the client declareselicitation.form). An accepted answer is steered into the asking turn withturn/steer+expectedTurnIdin the<send_user_message_question_reply>envelope. Open questions are cancelled with$/cancel_requestat turn end, session close or app-server loss. A late answer is dropped with an "Answer not sent" warning notice when the client supports notices. Stored reply envelopes replay as quoted question + answer. Works on ACP v1 and v2; on v2 the elicitation is not a user action, so the session staysrunning.Checks run locally
npm cinpm run typecheck: passesnpm test: 2479 passed, 40 skipped, 3 failed. The 3 failures are timeouts inscripts/verify-sync-source-review.test.mjs. They fail the same way on unmodifiedalashere and pass with--testTimeout=60000.npm run test:maintenance: same 3 timeouts, the rest pass. The ledger validates.npm run test:integration: 18 passednpm run buildandnpm run bundle:darwin-arm64: the output containsrequest_user_input_async,delivery: "async", the reply envelope,expectedTurnIdand "Answer not sent".Merge with a merge commit, not a squash. The ledger anchors
e57bcd768c8cebd1d3d17b840ae0db2e11639615.