Repository navigation
feat(opencode): TUI half reports blocked state from permissions and forms (#310) - #314
Conversation
…orms (amirlehmam#310) Phase 3a of the CLI-side (TUI) half: a pane whose TUI is a client of a remote or shared server now shows "Needs you" — the server half cannot see those processes, so nothing could mark them blocked before. v2 announces the asks as `permission.asked` (id, sessionID, action, resources, optional message) and `form.created` (form.id/sessionID/title). Both report through the existing `report-agent --blocked`: reason from the permission's message, else its action, else a generic; the form's title. Cleared only by an explicit `permission.replied`, `form.replied`/ `form.cancelled`, or a turn-ending `session.execution.interrupted|failed` — tool and streaming events never unblock, because the ask's own tool part transitions within a frame of the ask (amirlehmam#189), and a block that clears itself is worse than one that lingers. Replays dedupe by request/form id; reasons cap at 200 chars like the server half. Same hosted-session scoping as prompts: the event stream is the whole server's. Also pins the two-producer prompt dedupe that was asked for: both halves reporting one submission inside the renderer's 1500 ms window still produces a single log entry, and a deliberate repeat later produces two. Plugin marker 2 → 3 so installed halves update. Part of amirlehmam#310
Follow-up to #314. One reply cleared every pending ask, a reply that arrived after the session left the pane's tabs was dropped (stranding "Needs you"), and a replay of an answered ask raised it again. Asks are now tracked by id with their session: the pane unblocks when the last one is answered, a reply to a known ask always counts, and a turn failure clears only its session. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @Mattheinrichs — 3a is merged and ships in v2.33.0, together with the two-producer prompt pin. During review I changed one thing in
Each open ask is now tracked by id together with its session. The pane unblocks when the last one is answered. A reply to a known ask counts whatever is on screen. An answered id is remembered (bounded) so a replay of it is ignored. 3b (absolute |
Phase 3a of the CLI-side (TUI) half, following the plan in #310. The server half cannot see a pane whose TUI is a client of a remote or shared server, so until now nothing could mark such a pane "Needs you".
Events (verified against
packages/schema/src/permission.tsand the bundled TUI notifications plugin):permission.asked{id, sessionID, action, resources, message?}report-agent --blocked "<message ?? action ?? generic>"permission.replied{sessionID, requestID, reply}--unblockedform.created{form:{id, sessionID, title}}--blocked "<form.title>"form.replied/form.cancelled--unblockedsession.execution.interrupted/.failed--unblocked(mirrors the server half's error/interrupt)sessionIDunderform.askReason.tests/unit/prompt-log-dedupe.test.tspins the renderer's 1500 ms identical-text window — both halves reporting one submission → one log entry; a deliberate repeat later → two.Verification
opencode-tui-core(8 blocked cases), entry-shape assertions, and the dedupe pin — 57 tests in the three TUI-related files, watched red first (the dedupe pin passes by design; it characterizes existing behaviour).path.joinfailures that also fail on untouched master in this container.npm run typecheck, entry syntax check,node --checkon the core pass. No CLI changes, so noresources/clirebuild.Live check after merge (same setup as #311/#312):
wmux opencode-tui(v2 → v3), trigger a permission-requiring action → sidebar shows "Needs you" with the reason; reply → clears. A form (form.created) behaves the same.3b (working/idle via absolute
report-agent --run-depth) follows in its own PR.Part of #310