Skip to content

feat(tui): show required operator input at the composer - #1393

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-10189-show-required-input-for-primary-session-ask_operator-at-the
Oct 13, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-10189-show-required-input-for-primary-session-ask_operator-at-the

Conversation

@bwachman

@bwachman bwachman commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Note on base

This branch is stacked on the cl-10200-make-parked-worker-ask_director-questions-visible-and branch (tip 108bae6), which provides the worker-wait / parked-question machinery this feature coexists with. The diff in this PR is the CL-10189 change only.

Summary

Show the required operator input at the composer: when a primary session's ask_operator gate requires operator input, a persistent, theme-aware, width-safe INPUT REQUIRED strip renders in the composer-adjacent row with a provenance marker. The strip is keyed and deduped by OperatorGateEvent.id, only the primary ask_operator is eligible (fails closed for MCP/unmarked/permission/ask_director/OAuth), and every terminal path removes exactly the settled ID. Overlay and routing behavior are unchanged.

Verification

After the rebase onto main and the review fixes, CI passes on 8638639; the results below are from the original verification.

Gate Result Exit
bun test src/tui/operator-input-required.test.ts src/tui/operator-input-required-chrome.test.ts src/tui/gate-wire.test.ts src/tui/product-host.test.ts src/tui/worker-wait.test.ts src/tui/worker-wait-chrome.test.ts src/tui/geometry.test.ts src/tui/runner/session.operator-input-required.test.ts 223 pass / 0 fail, typecheck clean, no regression 0

All 7 findings in CL-10189-review-v2.md resolved (geometry invariant; gate-wire same-ID drop removed with two-distinct-objects tests; AC4 free-text/Esc/timeout route + product-host teardown + Phase-4 session integration; AC1 persistence incl. live theme switch; wrong-marker test; stale comments; plan negatives).

AC to code and test mapping

  • AC1 persistent INPUT REQUIRED strip, provenance marker only in primary onOperatorGate: src/tui/runner/session.ts + src/tui/operator-input-required-chrome.test.ts (persistence incl. live theme switch)
  • AC2 keyed/dedup by OperatorGateEvent.id, (+N more): src/tui/operator-input-required.ts + operator-input-required.test.ts + operator-input-required-chrome.test.ts
  • AC3 only primary ask_operator eligible, fails closed: src/tui/gate-events.ts predicate + operator-input-required.test.ts + gate-wire.test.ts (MCP/unmarked/permission/ask_director/OAuth negatives)
  • AC4 every terminal path removes exactly the settled ID: src/tui/gate-wire.ts settleOnce + gate-wire.test.ts (accept/text/Esc/timeout/abort/teardown) + operator-input-required.ts:77-89
  • AC5 overlay/routing unchanged: src/tui/gate-wire.ts (one listener, NOOP default hooks) + product-host.test.ts
  • AC6 theme-aware width-safe composer-adjacent row, collapse policy: src/tui/geometry/zones.ts + geometry.test.ts + geometry/resolve.ts + operator-input-required-chrome.test.ts

Deferred / Notes

  • User-facing recovery interaction is a separate ticket; non-goals per BUILD_PLAN (no clickable strip, no persistence across restart, no changes to ask_director/send_input/permission/OAuth).

Refs CL-10189

@linear-code

linear-code Bot commented Oct 11, 2026

Copy link
Copy Markdown

CL-10189

@bwachman
bwachman force-pushed the cl-10189-show-required-input-for-primary-session-ask_operator-at-the branch from 62feb32 to dc48681 Compare October 11, 2026 16:32
@bwachman
bwachman changed the base branch from main to cl-10200-make-parked-worker-ask_director-questions-visible-and October 11, 2026 16:32
@bwachman
bwachman force-pushed the cl-10189-show-required-input-for-primary-session-ask_operator-at-the branch from dc48681 to 0481351 Compare October 11, 2026 18:17
Comment thread docs/TUI.md Resolved
Comment thread src/tui/product-host.ts Resolved
Comment thread src/tui/shell/chrome.ts Resolved
Comment thread src/tui/operator-input-required.ts Resolved

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strip implementation is sound — fails-closed eligibility, settle-once across every terminal path, and overlay/routing invariance all verified (221/0 on the PR's own gate). Five items: one should-fix (strip not cleared on session clear), a same-id duplicate to pin, a doc overstatement, a comment omission, and a wrong AC1 test mapping in the body.

AC1 credits operator-input-required.test.ts for "persistence incl. live theme switch"; the live-switch test is in operator-input-required-chrome.test.ts:183 and the unit test is view-model-only. Fix the mapping.

@bwachman
bwachman force-pushed the cl-10189-show-required-input-for-primary-session-ask_operator-at-the branch from 0481351 to 8638639 Compare October 13, 2026 00:50
@bwachman
bwachman force-pushed the cl-10200-make-parked-worker-ask_director-questions-visible-and branch from b72ebc9 to 108bae6 Compare October 13, 2026 00:50
@bwachman

Copy link
Copy Markdown
Contributor Author

AC1 mapping fixed in the PR body: the live theme switch test is in operator-input-required-chrome.test.ts (operator-input-required-chrome.test.ts), and the body now credits that file for AC1. I also refreshed the stale base tip and test count in the body.

@TheGreatAxios
TheGreatAxios force-pushed the cl-10189-show-required-input-for-primary-session-ask_operator-at-the branch from 8638639 to b1b64b2 Compare October 13, 2026 01:31
@TheGreatAxios
TheGreatAxios changed the base branch from cl-10200-make-parked-worker-ask_director-questions-visible-and to main October 13, 2026 01:31
@TheGreatAxios
TheGreatAxios merged commit d34c71e into main Oct 13, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants