diff options
| author | Michelle Tilley <michelle@michelletilley.net> | 2026-04-21 15:30:46 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-21 15:30:46 -0700 |
| commit | 8dec33f5f9a972a38978b5600fde5bc292fb6401 (patch) | |
| tree | 19708731284c8ba810a5acede4720d3396f9e5a2 /crates/atuin-ai/src/fsm/effects.rs | |
| parent | fix: shell tool preview stuck as Running after completion (#3436) (diff) | |
| download | atuin-8dec33f5f9a972a38978b5600fde5bc292fb6401.zip | |
feat: shell tool execution timeouts (#3437)
Diffstat (limited to 'crates/atuin-ai/src/fsm/effects.rs')
| -rw-r--r-- | crates/atuin-ai/src/fsm/effects.rs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/crates/atuin-ai/src/fsm/effects.rs b/crates/atuin-ai/src/fsm/effects.rs index ede72a42..306f1401 100644 --- a/crates/atuin-ai/src/fsm/effects.rs +++ b/crates/atuin-ai/src/fsm/effects.rs @@ -61,14 +61,27 @@ pub(crate) enum Effect { ArchiveSession, // ─── Timers ───────────────────────────────────────────────── - /// Schedule a timer that will fire ConfirmationTimeout after delay. - ScheduleTimeout { timeout_id: u64, duration: Duration }, + /// Schedule a timer that fires an event after the given delay. + ScheduleTimeout { + timeout_id: u64, + duration: Duration, + kind: TimeoutKind, + }, // ─── Exit ─────────────────────────────────────────────────── /// Exit the application with the given action. ExitApp(ExitAction), } +/// What kind of timeout was scheduled. +#[derive(Debug, Clone, PartialEq, Eq)] +pub(crate) enum TimeoutKind { + /// Dangerous command confirmation dialog auto-dismiss. + Confirmation, + /// Shell tool execution timeout — abort the tool if it's still running. + ToolExecution { tool_id: String }, +} + /// What to do when exiting the TUI. #[derive(Debug, Clone, PartialEq, Eq)] pub(crate) enum ExitAction { |
