ticket: approve panel quit latency

This commit is contained in:
Keisuke Hirata 2026-06-13 20:40:31 +09:00
parent 8de8283634
commit 2bb36cc40d
No known key found for this signature in database
2 changed files with 29 additions and 1 deletions

View File

@ -2,7 +2,7 @@
title: 'Panel Quit 時の断続的な遅延を調査して解消する' title: 'Panel Quit 時の断続的な遅延を調査して解消する'
state: 'inprogress' state: 'inprogress'
created_at: '2026-06-13T10:04:55Z' created_at: '2026-06-13T10:04:55Z'
updated_at: '2026-06-13T11:35:16Z' updated_at: '2026-06-13T11:40:01Z'
assignee: null assignee: null
readiness: 'spike_needed' readiness: 'spike_needed'
risk_flags: ['tui-panel', 'shutdown-latency', 'async-cancellation'] risk_flags: ['tui-panel', 'shutdown-latency', 'async-cancellation']

View File

@ -193,4 +193,32 @@ Residual risks / manual validation notes:
- I did not run an interactive manual `yoi panel` session from this Coder environment. Recommended manual check: start `yoi panel`, trigger a reload/queued Ticket condition that would dispatch queue-attention notice, then press `Ctrl+C`/`Ctrl+D` while the notice target is slow or unavailable; the Panel should exit promptly while terminal state is restored. - I did not run an interactive manual `yoi panel` session from this Coder environment. Recommended manual check: start `yoi panel`, trigger a reload/queued Ticket condition that would dispatch queue-attention notice, then press `Ctrl+C`/`Ctrl+D` while the notice target is slow or unavailable; the Panel should exit promptly while terminal state is restored.
---
<!-- event: review author: hare at: 2026-06-13T11:40:01Z status: approve -->
## Review: approve
Review: approve
Evidence:
- Reviewed Ticket intent/criteria and `git diff 9dacc90e..HEAD` for commits `cfe411e5` and `8de82836`.
- The reported delay cause is plausible in the previous loop shape: a completed reload was processed before input polling and could inline-await queue-attention notice dispatch; that dispatch uses Pod socket connect/read/write paths, so queued `Ctrl+C` / `Ctrl+D` input could wait behind nonessential notice work.
- The implementation changes only `crates/tui/src/multi_pod.rs` plus the implementation report. Queue-attention notice dispatch is now wrapped in a cancellable `PendingQueueAttentionNotice`, started in the background, and harvested only after completion. Reload dispatch is guarded against overlap.
- Quit handling now calls `abort_panel_background_work_for_quit`, aborting pending reload and pending queue-attention notice tasks before returning the existing `MultiPodOutcome::Quit`; this keeps the established terminal/backend cleanup return path intact.
- Existing foreground open/action helper paths also abort the nonessential pending notice before returning user-directed outcomes, so stale notice dispatch does not block those paths.
- No Ticket lifecycle authority, Pod authority boundary, Panel row/action semantics, composer target semantics, prompt resources, or Ticket schema changes were introduced.
- The regression test starts never-completing reload and notice futures, exercises the quit abort helper under a timeout, and verifies cancellation of both tasks. This is a meaningful regression for the pending-background-work latency path rather than only checking that a helper was wired.
Validation performed:
- `cargo test -p tui multi_quit_aborts_background_reload_and_notice_without_waiting --lib` — passed.
- `cargo test -p tui multi_poll_reload_does_not_overlap_in_flight_reload --lib` — passed.
- `cargo fmt --check` — passed.
- `git diff --check` — passed.
- `cargo check -p tui --all-targets` — passed.
Risks / notes:
- I did not run an interactive `yoi panel` manual latency check. The code-path review and focused tests cover the identified nonessential reload/notice wait path.
--- ---