From fd188da879d977ca847f10708c39dd4801a204c4 Mon Sep 17 00:00:00 2001 From: Michelle Tilley Date: Tue, 14 Apr 2026 16:03:08 -0700 Subject: feat: Allow resuming previous AI sessions (#3407) This PR introduces session continuation to Atuin AI. * Conversations with Atuin AI are stored in a local SQLite database * Upon startup, Atuin AI tries to find a session to resume based on its directory/workspace and the time since the last event * If found, Atuin AI will show a note that the session has been resumed, and an event is added to help the LLM know where the invocation boundaries are * If not, Atuin AI will create a new conversation * The user can create a new conversation with `/new` * The new setting `ai.session_continue_minutes`, which defaults to `60`, controls how old the last event in a session can be before it's no longer considered for automatic resuming. image ## Architecture A new `SessionService` trait defines an API contract for a service that can manage session data. `LocalSessionService` implements this, with `DaemonSessionService` a possible future extension point. `SessionManager` owns a `dyn SessionService` and delegates as appropriate. --- crates/atuin-ai/Cargo.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'crates/atuin-ai/Cargo.toml') diff --git a/crates/atuin-ai/Cargo.toml b/crates/atuin-ai/Cargo.toml index c5f66695..3bdd45d2 100644 --- a/crates/atuin-ai/Cargo.toml +++ b/crates/atuin-ai/Cargo.toml @@ -17,6 +17,7 @@ default = [] tree-sitter = ["dep:tree-sitter-lib", "dep:tree-sitter-bash", "dep:tree-sitter-fish"] [dependencies] +async-trait = { workspace = true } atuin-client = { workspace = true } atuin-common = { workspace = true } tokio = { workspace = true } @@ -36,6 +37,7 @@ serde = { workspace = true } serde_json = { workspace = true } crossterm = { workspace = true, features = ["use-dev-tty", "event-stream"] } ratatui = { workspace = true } +fs-err = { workspace = true } futures = "0.3" eventsource-stream = "0.2" pulldown-cmark = "0.13.0" @@ -43,7 +45,7 @@ async-stream = "0.3" uuid = { workspace = true } tui-textarea-2 = "0.10.2" unicode-width = "0.2" -eye_declare = "0.4" +eye_declare = "0.4.2" ratatui-core = "0.1" ratatui-widgets = "0.3" thiserror = { workspace = true } @@ -55,8 +57,11 @@ toml_edit = { workspace = true } tree-sitter-lib = { package = "tree-sitter", version = "0.26.8", optional = true } tree-sitter-bash = { version = "0.25.1", optional = true } tree-sitter-fish = { version = "3.6.0", optional = true } +sqlx = { workspace = true, features = ["sqlite"] } typed-builder = { workspace = true } vt100 = { workspace = true } +chrono = "0.4" +chrono-humanize = "0.2" [dev-dependencies] pretty_assertions = { workspace = true } -- cgit v1.3.1