research: AskUserQuestion detection design comparison (co-design input for main)#1206
research: AskUserQuestion detection design comparison (co-design input for main)#1206amrmelsayed wants to merge 1 commit into
Conversation
…arsing vs transcript tailing)
Main architect co-design review: rulings on the four open questionsVerified the load-bearing claims against source before ruling: the Q1 (architect coverage): v1 is builders-onlyBuilders are where an unanswered AskUserQuestion silently stalls a lane; that is the high-value detection target. Architects are human-attended sessions in the main checkout, and every settings-injection option there collides with sessions we don't own: spawn-writing Q2 (response injection): hard split confirmedDetection ships as detect-and-notify; the answer happens at the desk in v0. Remote answering is its own spike with its own gate. Beyond the fragility you list, note: AskUserQuestion always offers a free-text "Other" option (arrow-keys-plus-enter synthesis can't cover it), multiSelect changes the key sequence, and a desk human can race the remote answer with the TUI as the only arbiter, so Tower-side compare-and-set protects Tower's record but cannot protect the terminal. The spike must define stale-answer semantics before any injection ships. Please amend interaction-model §8.3 accordingly once this lands. Q3 (transport): split, as you lean
Sequencing consequence: #1194 lands first (it is spawn-ready, awaiting Amr's go), and this rides its envelope. Design the union member here but don't spawn implementation ahead of #1194. Q4 (
|
The design comparison owed to main for interaction-model §8.1: how Tower learns an agent called AskUserQuestion. Ground-truthed 2026-07-19.
Compares three mechanisms: (A) harness-side hooks — recommended; Codev already generates a per-builder PreToolUse hook at spawn (the #1018 worktree write-guard), so the seam, harness abstraction, and precedent all exist; PreToolUse = question_pending with the structured payload from tool_input, PostToolUse = question_resolved. (B) PTY parsing — rejected on ground truth (interactive ANSI menu, no semantic markers, no fixtures, inverts the repo's explicit-emission idiom). (C) transcript tailing — viable fallback (JSONL transcripts exist and Codev already discovers the files) but couples Tower to an undocumented harness-internal format; kept as a possible architect-side bridge.
Recommends a harness-neutral Tower contract (the hook is just the first emitter), reusing #1194's BusEventMeta envelope, with persistence per decisions/q3.
Four open questions flagged for main: architect hook coverage (builders get spawn-written hooks; architects don't), response injection being a separate harder problem than detection (v0 may ship detect-and-notify with answer-on-desktop), transport (dedicated endpoint vs #1194 path), and porch's reserved-but-unused
awaiting_inputfield.Related: #1147 (prereq 1), #1194 (envelope reuse), #1189 (consumer seams).