6.0 KiB
6.0 KiB
| title | state | created_at | updated_at | assignee | readiness | risk_flags | ||
|---|---|---|---|---|---|---|---|---|
| TUI Console: Paused 中の Ctrl+X で中断ターンをキャンセルできるようにする | ready | 2026-06-23T07:02:07Z | 2026-06-23T07:02:07Z | null | implementation_ready |
|
User claims / request snapshot
- TUI Console で、
Ctrl+Cにより Pause している状態のとき、Ctrl+Xでキャンセルできるようにしたい。
Confirmed facts / sources
- 既存 Ticket:
- 未完了 Ticket に直接 duplicate は確認できなかった。
00001KSVP63K8 Support immediate in-flight TUI composer injectionは TUI 実行中入力に関連するが、「Do not interrupt/cancel the current run」が non-goal なので今回の要求とは別件。
crates/tui/src/console/mod.rs- 現在の
Ctrl+XはPodStatus::RunningのときだけMethod::Cancelを返す。 PodStatus::Paused | PodStatus::IdleのときはMethod::Shutdownを返している。Ctrl+Cは Running ではMethod::Pause、Idle/Paused では TUI 終了の 2-tap guard として扱われている。- 既存 test
pause_and_cancel_clear_queued_inputは名前上 pause/cancel を扱うが、Ctrl+C後に app status を Paused に更新していないため、Paused 状態でのCtrl+Xcancel は実質カバーしていない。
- 現在の
crates/protocol/src/lib.rsMethod::Pauseは in-flight turn を止めて Paused に遷移するもの。- コメント上、
Cancelは破棄して Idle に戻る意味を持ち、Paused はResumeまたは新規Runが可能。
crates/pod/src/controller.rs- 非 running 側の
Method::Cancelは現状NotRunningerror を返す経路があるため、TUI keymap 変更だけでなく Paused 状態の cancel semantics を確認・必要なら実装する必要がある。
- 非 running 側の
Unverified hypotheses
- 実装は比較的小さい可能性が高いが、
Paused状態でMethod::Cancelを受け取った時に、Worker/Pod の interrupted state や orphan tool-use cleanup をどう clear するべきかは実装時に確認が必要。 - UI 表示は paused hint に
Ctrl+X to cancel相当を追加するだけで足りる可能性がある。
Undecided points / open questions
- blocking な未決定点はなし。
- Orchestrator/実装者判断で、
Ctrl+Xの Idle 挙動を現状通りShutdownに残すか、Paused のみCancelに分岐するのがよさそう。
Background
Ctrl+C で Pause した turn は resume 可能だが、ユーザーが「やっぱりこの中断 turn は破棄したい」と判断した時に、Console 上の自然な操作として Ctrl+X cancel が効くべき。現在は Paused/Idle の Ctrl+X が shutdown に割り当てられており、Paused turn のキャンセル導線として機能していない。
Requirements
- TUI Console で Pod が
Pausedのとき、Ctrl+Xは shutdown ではなく paused/interrupted turn の cancel を要求する。 Running中のCtrl+X -> Method::Cancelは維持する。Idle中のCtrl+Xの挙動は、意図的に変更する理由がなければ現状の shutdown を維持する。- Paused 状態で cancel した後、Pod は resume 可能な paused turn を残さず、Idle 相当として次の入力を受けられる。
- queued input がある場合は、既存 Running cancel と同様に誤送信されないよう clear される。
- UI の paused hint / actionbar / tests など、ユーザーが操作を理解できる範囲を必要に応じて更新する。
Acceptance criteria
Ctrl+Cで Running turn を Pause した後、Console 上でCtrl+Xを押すと、TUI 終了や Pod shutdown ではなく turn cancel が実行される。- Paused cancel 後、
Enterで前の turn を resume しようとしても resume されない。 - Paused cancel 後、新規入力は通常の新規 turn として扱われる。
- Running 中の
Ctrl+Xcancel と Idle 中のCtrl+X挙動に意図しない regressions がない。 - Focused tests が Paused 状態の
Ctrl+Xkey handling と Pod/controller 側の cancel semantics をカバーする。
Binding decisions / invariants
Ctrl+Cの Pause semantics は変更しない。Ctrl+Cの Idle/Paused 2-tap TUI quit guard は、この Ticket では置き換えない。- この Ticket は in-flight input injection / history append policy を扱わない。
- provider stream を直接 mutate しない。
- cancel は hidden context/history mutation ではなく、既存の typed
Method::Cancelsemantics またはそれに準じる明示的 lifecycle 操作で表現する。
Implementation latitude
Paused中のCtrl+XをMethod::Cancelに変えるだけで足りるか、controller/worker 側に Paused cancel handling を追加するかは実装調査で判断してよい。- UI hint の文言や配置は実装者に任せてよい。
- 必要なら既存 test を修正・分割して、「Running cancel」と「Paused cancel」を明確に分ける。
Readiness
- readiness: implementation_ready
- risk_flags: [tui-keybinding, pod-lifecycle]
Escalation conditions
Method::Cancelを Paused 状態に拡張すると session/history cleanup や orphan tool-result closure の設計判断が必要になる場合は、実装者は Orchestrator/maintainer に戻す。Ctrl+Xの Idle 挙動変更が必要になる場合は、別途合意を取る。
Validation
- Focused tests:
cargo test -p tui pauseまたは該当 TUI key handling testscargo test -p pod cancelまたは controller paused cancel の focused tests
- 通常確認:
cargo fmt --check- 必要に応じて
cargo check -q - terminal UX 変更なので、可能なら実機 TUI/manual check も推奨。
Related work
- Related, not duplicate:
.yoi/tickets/00001KSVP63K8 - Files:
crates/tui/src/console/mod.rscrates/tui/src/ui.rscrates/protocol/src/lib.rscrates/pod/src/controller.rs