codex icon indicating copy to clipboard operation
codex copied to clipboard

[CLI/TUI] Async questions stay collapsed and a combined answer leaves all but the first question pending

Open solo-race opened this issue 2 months ago • 6 comments

Problem and impact

The CLI places questions under Queued follow-up inputs as a small question count. I have to press Shift+Left to open them. When I answer several questions together, only the first is cleared; the others remain pending.

This forces me to manage two conflicting states: the answers I have supplied and the harness's stale pending-question list. The user should not have to act as a garbage collector for the question queue.

Environment

  • Codex CLI/TUI; version reported during this troubleshooting session: 0.156.0.
  • Observed in the native Windows workflow, using VS Code terminal and PowerShell 7.6.6.
  • ChatGPT Pro 5x.
  • No Windows-only claim is being made for this question-state behavior.

Observed workflow

  1. The assistant creates asynchronous follow-up questions.
  2. The TUI leaves them collapsed under Queued follow-up inputs, showing a question count and shift+left to answer.
  3. Open the editor and provide a combined answer covering the questions.
  4. Only the first question loses its pending state; the others remain in the queue.

The exact answer-delivery route was not captured in a trace. The focused-editor path below explains why a combined reply submitted in one question field can produce this result.

Source findings

In rust-v0.156.0:

  • async_questions/mod.rs explicitly initializes questions collapsed and documents that arrivals do not take focus. This part is a deliberate interaction policy; an option to expose incoming questions is needed.
  • chatwidget/questions.rs opens the question editor through queue-navigation shortcuts.
  • async_questions/state.rs creates a separate ID for each question. Submission wraps only the focused question's ID, and accept_answer() removes only the focused entry.

Consequently, one answer field containing answers to multiple questions cannot reconcile all those question IDs through this path. The conversation can contain the answers while the visible queue still treats the other questions as unanswered.

Required behavior

  • Make incoming questions discoverable without requiring users to notice a small collapsed counter; provide an auto-expand preference while preserving any composer draft.
  • Provide a supported way to submit answers to several questions and resolve the corresponding IDs together.
  • Allow specific questions to be resolved or withdrawn when answered elsewhere or made obsolete, with the UI updated consistently.
  • Provide a clear bulk-dismiss action for stale questions. Dismissal must not fabricate an answer or approval.
  • Keep unresolved questions separate from resolved ones across later turns and replay.

Manually pressing Ctrl+] for each stale item is a workaround. Fix the lifecycle so routine answers do not leave cleanup work for the user.

Related: #44648 covers stale questions after ordinary-chat answers; #46169 covers cross-client answers. #47424 clears lingering notifications on turn termination and does not implement combined-answer resolution or automatic expansion.

solo-race avatar Sep 23 '26 11:09 solo-race

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #46169

Powered by Codex Action

github-actions[bot] avatar Sep 23 '26 11:09 github-actions[bot]

Hi @solo-race, I'm trying to reproduce this but have been unsuccessful so far.

When I answer several questions together, only the first is cleared; the others remain pending.

Are you saying that you're typing the answer to all of the questions into a single input field (the first question)?

imac-oai avatar Sep 23 '26 22:09 imac-oai

Hi @imac-oai, thanks for looking into this. My original description was unclear: I am not typing answers to multiple questions into a single input field.

These are questions with predefined choices, generated when my agent orchestration skill asks which agent identities to use and whether a human supervisor is present. I select an existing option for each question; no free-text answer is involved.

The important difference is the timing:

  1. If I submit the choices for multiple questions in quick succession, without waiting for an assistant response between submissions, the assistant appears to recognize only the first answer and asks the remaining questions again.
  2. If I submit one answer, wait for the assistant to acknowledge it, and then submit the next answer, the duplicate questions do not occur.

The skill explicitly instructs the assistant to retain these choices for the session and not restart initialization. I have also used the same skill in Oh-My-Pi without encountering this behavior, although that alone does not establish the cause.

I cannot tell yet whether the later answers are delayed in the queue, lost, or delivered but not incorporated before the assistant generates the questions again. The behavior to reproduce is consecutive submissions of predefined choices without waiting for an assistant response, rather than a combined answer in one field.

solo-race avatar Sep 24 '26 03:09 solo-race

The clarification makes this look more like a pending-question correlation / turn barrier problem than a “combined answer” problem.

A useful invariant for a repro might be:

accepted answer(q1) must resolve q1
accepted answer(q2) must resolve q2

and if q1 + q2 are accepted before the next assistant generation,
that generation must observe both accepted transitions
(or the client must explicitly define that submissions are serialized)

I’d capture four IDs/timestamps for each submission if the app-server exposes them:

  • pending question ID
  • client submission/event ID
  • server acknowledgement
  • assistant generation start

Then test the same two questions in:

  1. q1 → wait → q2
  2. q1 → q2 immediately
  3. q2 → q1 immediately
  4. one answer from another client, if supported

That should distinguish “second answer never left the TUI” from “server accepted it but generation raced ahead” from “answer was accepted but stale pending state was not reconciled.”

One lifecycle detail also seems important: dismiss / obsolete / answered-elsewhere should be terminal states distinct from ‘answered’. Otherwise cleanup can accidentally manufacture a semantic answer.

hippoley avatar Sep 26 '26 06:09 hippoley

I can reproduce the discoverability part of this issue in a native Windows Terminal / PowerShell Codex TUI workflow, and in my case it is painful even with one pending async question.

Concrete workflow:

  1. Start a long-running Codex root-cause/debugging task.
  2. Leave the terminal visible but do other work while Codex iterates.
  3. Codex eventually needs one human action/input before it can continue.
  4. The question appears only under the small Queued follow-up inputs area at the bottom.
  5. The terminal tab title changes to [!] Action Required, but the actual blocking question remains visually easy to miss in a long transcript.
  6. The task can sit stalled for many minutes until I happen to inspect the bottom pane.

In the captured case, Codex had been working for ~11 minutes and then asked me to run one sudo/read-only command. I did not notice that it was waiting for me. The issue was not that I misunderstood the question; I simply did not see that a new blocking question had arrived.

So I think there are two separate UX requirements here:

  • Question lifecycle/correlation (the existing discussion in this issue).
  • Attention/discoverability for blocking questions: if Codex cannot continue until the user answers, that question should not remain a subtle collapsed queue item.

Suggested behavior for a genuinely blocking async question:

  • auto-expand the incoming question, or provide a preference to auto-expand;
  • show a persistent high-contrast “Waiting for your input” banner near the active status area;
  • preserve the existing composer/draft;
  • on Windows, optionally request taskbar attention / desktop notification / sound;
  • keep the terminal-title Action Required state, but do not rely on the title alone.

Related requests such as #28013 (attention sounds) and #18162/#36132 (terminal-title Action Required) help, but the core problem here is that the blocking question itself remains too easy to miss inside the TUI.

For power-user workflows with 10–30 minute agent runs, this turns “you can leave Codex working” into “you still have to keep checking whether it secretly stopped for a question.”

jordanovt avatar Sep 28 '26 13:09 jordanovt

My current workaround is adding this line to the global prompt:

- Do not use `request_user_input_async`, wait for the user's reply before continuing.

hyrious avatar Sep 28 '26 14:09 hyrious