Repository navigation
Commit cc57c7e
authored
feat: show async Codex questions as elicitations (#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.1 parent 34e0897 commit cc57c7e
22 files changed
Lines changed: 1097 additions & 130 deletions
File tree
- docs
- src
- __tests__
- CodexACPAgent
- data
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
142 | 152 | | |
143 | 153 | | |
144 | 154 | | |
| 155 | + | |
145 | 156 | | |
| 157 | + | |
146 | 158 | | |
147 | 159 | | |
148 | 160 | | |
| |||
152 | 164 | | |
153 | 165 | | |
154 | 166 | | |
155 | | - | |
| 167 | + | |
156 | 168 | | |
157 | 169 | | |
158 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
| |||
524 | 525 | | |
525 | 526 | | |
526 | 527 | | |
| 528 | + | |
| 529 | + | |
527 | 530 | | |
528 | 531 | | |
529 | 532 | | |
| |||
2025 | 2028 | | |
2026 | 2029 | | |
2027 | 2030 | | |
| 2031 | + | |
| 2032 | + | |
2028 | 2033 | | |
2029 | 2034 | | |
2030 | 2035 | | |
| |||
4067 | 4072 | | |
4068 | 4073 | | |
4069 | 4074 | | |
4070 | | - | |
| 4075 | + | |
| 4076 | + | |
| 4077 | + | |
4071 | 4078 | | |
4072 | 4079 | | |
| 4080 | + | |
4073 | 4081 | | |
4074 | 4082 | | |
4075 | 4083 | | |
| |||
4898 | 4906 | | |
4899 | 4907 | | |
4900 | 4908 | | |
| 4909 | + | |
4901 | 4910 | | |
4902 | 4911 | | |
4903 | 4912 | | |
4904 | 4913 | | |
4905 | 4914 | | |
4906 | 4915 | | |
4907 | 4916 | | |
| 4917 | + | |
| 4918 | + | |
4908 | 4919 | | |
4909 | 4920 | | |
4910 | 4921 | | |
| |||
5420 | 5431 | | |
5421 | 5432 | | |
5422 | 5433 | | |
| 5434 | + | |
| 5435 | + | |
| 5436 | + | |
| 5437 | + | |
| 5438 | + | |
| 5439 | + | |
| 5440 | + | |
| 5441 | + | |
| 5442 | + | |
| 5443 | + | |
| 5444 | + | |
| 5445 | + | |
| 5446 | + | |
5423 | 5447 | | |
5424 | 5448 | | |
5425 | 5449 | | |
| |||
5432 | 5456 | | |
5433 | 5457 | | |
5434 | 5458 | | |
| 5459 | + | |
5435 | 5460 | | |
5436 | 5461 | | |
5437 | 5462 | | |
| |||
0 commit comments