| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Root cause: IOProxy.get_input only honored a coder's input queue in TUI mode. In non-TUI mode it delegated straight to the base InputOutput terminal prompt, so answers pushed onto a coder's queue by the WebSocket server, the ACP adapter, or AgentService.wake_primary were silently dropped. confirm_ask had the same gap, so queued confirmations were dropped too. Fix: in non-TUI mode, sweep this coder's queue first. If no payload is waiting and a cancellable prompt session is present, race the terminal read against the per-coder queue wake so a push is delivered even while the prompt is open. The global InterruptibleInput/input() fallback stays a plain blocking read (marked with a ponytail: note) because it cannot be cancelled; a push arriving during that read is delivered on the next get_input() cycle. Shape rationale: the wake event in helpers/queues is global, so the race loop re-checks this coder's own queue after every wake rather than trusting a single signal. A payload for a different reader is put back so its own waiter can consume it. Confirmations reuse the same path and share the TUI payload mapping (never/tweak/all/skip/bool) so both modes agree. Tests cover queued text, a push delivered while the prompt is open, a confirmation left for confirm_ask by get_input, and queued true/false confirmations.
| Back | FazBrowse Home | New Git URL |
Problem
With tui: false, IOProxy.get_input delegated straight to the base
InputOutput terminal prompt and never drained the per-coder queue that
IOProxy.__init__ registers. So input pushed via queues.push_coder_input(...)
from the WebSocket server (cecli/helpers/server/ws_server.py), the ACP adapter
(cecli/helpers/server/acp/protocol.py), or AgentService.wake_primary
(cecli/helpers/agents/service.py) was silently dropped. confirm_ask had the
same gap, dropping queued confirmations. tui: true was unaffected because
TextualInputOutput.get_input drains the queues.
This also contradicted wake_primary's docstring, which assumes the idle primary
blocks in wait_for_input().
Fix
Non-TUI IOProxy.get_input now:
terminal read against the per-coder queue wake, so a push is delivered even
while the prompt is open.
path, which cannot be cancelled (marked with a ponytail: note naming the
ceiling).
Confirmations take the same route and reuse the TUI payload mapping
(never/tweak/all/skip/bool) so both modes agree.
Why this shape
The wake event in cecli/helpers/queues.py is global, so the race loop
re-checks this coder's own queue after each wake instead of trusting a single
signal. A payload meant for a different reader is put back so its own waiter
still consumes it.
Tests
tests/subagents/test_io_proxy.py: queued text returns (text, uuid) and logs
user_input; a push is delivered while the terminal prompt is open; a
confirmation is left for confirm_ask by get_input; queued true/false
confirmations return the expected values.
Verified offline: tests/subagents/test_io_proxy.py 16 passed,
tests/unit/test_queues.py 15 passed; black (--line-length 100 --preview),
isort, pycodestyle, pyflakes, codespell clean; interactive tui=false re-prompt
loop unchanged (no regression).
Related
Documentation follow-up for this change: #698 (documents the non-TUI
input contract; merge after this PR).