feat(tui): answer structured form interactions - #4392
Conversation
be4056c to
ed745fb
Compare
9fe4ef1 to
773a8c7
Compare
ed745fb to
032d77f
Compare
773a8c7 to
1b643ad
Compare
032d77f to
d8bae9f
Compare
0de6710 to
2c1e2b9
Compare
Astro-Han
left a comment
There was a problem hiding this comment.
PR #4392 — 2c1e2b9 — blind review sealed
Summary: TUI structured-form answer surface stacked on #4379/#4384. Exact head 2c1e2b9ec92f3ab92581de8e676451381ffec553 frozen. Source is approvable with comments; inherits #4379's 2×P2+1×P3. No simplify finding. Full build passed; CLI suites 396/396 green (70-test driver suite after TMPDIR parent fix), exact-head audit green; no hosted test on this head; 0 reviews/0 threads.
Findings (reproducible):
- P2 — reconnect clears pending drafts — replacement
reconnectclears pending interaction and closes overlay, discarding its only#draftscopy. Production recovery then re-seeds same still-pending Host request from defaults. Reducer+overlay probe typedrelease-candidate; after replacement + same-request seed it becameVersion (required): empty. Fix: preserve drafts by{sessionId, requestId}until authority resolves/removes request; add canonical same-request reseeding test. - P2 — constraints not rendered — all Core constraints enforced but none rendered (same as #4384 TUI). Overlay with required integer
min=max=997+ requireddate-timeshowed neither value, only generic invalid feedback → legal forms not discoverably answerable. Fix: render localized range/length/cardinality/format help and test.
Gating: current-main merge clean except explicitly ignored epoch conflict. Inherits base-stack risk.
Automated review notice: This comment was posted by an automated review agent operated by AstroHan. It is not an independent human review and does not replace one.
简体中文
本条结论来自 @捣蛋鬼 在 exact head 2c1e2b9 的独立盲审,已按 @me2seeks 指示排除 compatibility epoch 冲突的计分。编排仅核对 head 未漂移与 CI 状态。
d8bae9f to
1fba905
Compare
2c1e2b9 to
1804908
Compare
|
Fixed both findings in e898717. The TUI now keeps one schema-matched transient draft snapshot by session/request across the reconnect replay gap, while an authoritative replacement with another request still discards it. Active-field constraints are localized and visible. Added runner-level reconnect replay and overlay regressions. The rebase onto current main also required extending the catalog test values for the new constraint variables (1804908). |
Define a bounded provider-neutral primitive form contract and carry its request and acknowledgement facts through the Runtime Event Log. Broker pending forms through the existing InteractionStore authority so schema-invalid answers remain pending, concurrent equivalent answers converge on one canonical outcome, and Turn closure or Host restart closes the exact continuation. Part of #4364. Generated-by: OpenAI Codex
Expose one closed decoder for renderer-to-runtime form responses so surface adapters do not copy protocol validation. Queue the same canonical continuity refresh for form requests that user questions already receive. Refs #4364. Generated-by: OpenAI Codex
Review and edit Host-owned forms in the existing TUI interaction queue, preserving optional omission and all six primitive field kinds. Route accepted, declined, and cancelled responses through the generic Runtime Host interaction operation, while non-interactive runs stop the exact Turn instead of dropping the request. Keep requester provenance and sensitive-data guidance visible, validate with the shared Core contract, and retire stale overlays when authoritative transcript state changes. Part of #4364. Generated-by: OpenAI Codex
1fba905 to
4609622
Compare
1804908 to
c7abdac
Compare
a12633d to
066718d
Compare
Summary
maka runinstead of dropping a request it cannot answerWhy
#4379 establishes the provider-neutral, Host-owned form contract. Without a TUI adapter, an interactive CLI Turn that receives one of those requests has no way to continue. This PR keeps Runtime Host as the only lifecycle and answer authority; the overlay owns only an uncommitted local draft.
This is a sibling of the Desktop adapter in #4384. Both depend directly on #4379; neither surface depends on the other.
Part of #4364.
Screenshots
Captured from the production TUI runner at the exact parent and current heads.
Test plan
npx biome checkon all changed filesnpm run buildTMPDIR=/dev/shm/maka-4364-tui-tests node --test --test-reporter=dot 'packages/cli/dist/**/*.test.js'Generated-by: OpenAI Codex