From fdaade8e19bad21804057fe5741371edaa89c7a0 Mon Sep 17 00:00:00 2001 From: Daniel Kurzynski Date: Mon, 12 Oct 2026 18:25:33 +0200 Subject: [PATCH] feat(handoff): prepare the idle handoff after four minutes instead of two --- crates/code_assistant_core/src/session/idle_handoff.rs | 4 ++-- crates/ui_gpui/src/main_screen/mod.rs | 2 +- crates/ui_gpui/src/settings_screen/general_section.rs | 2 +- docs/handoff.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/code_assistant_core/src/session/idle_handoff.rs b/crates/code_assistant_core/src/session/idle_handoff.rs index 991f85cd..4aae88f5 100644 --- a/crates/code_assistant_core/src/session/idle_handoff.rs +++ b/crates/code_assistant_core/src/session/idle_handoff.rs @@ -1,5 +1,5 @@ //! Prepared handoffs (see `docs/handoff.md`): when a long session goes -//! idle, a timer gives the user two minutes; if they stay away, the core has +//! idle, a timer gives the user four minutes; if they stay away, the core has //! the agent write a handoff prompt while the prompt cache is still warm and //! offers it in the composer as `/new `. //! @@ -18,7 +18,7 @@ use std::time::{Duration, Instant}; use tracing::warn; /// How long a session must stay without user activity. -pub const IDLE_DELAY: Duration = Duration::from_secs(120); +pub const IDLE_DELAY: Duration = Duration::from_secs(240); /// Configuration persisted at `/handoff.json`. #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] diff --git a/crates/ui_gpui/src/main_screen/mod.rs b/crates/ui_gpui/src/main_screen/mod.rs index 77c8d81e..61717620 100644 --- a/crates/ui_gpui/src/main_screen/mod.rs +++ b/crates/ui_gpui/src/main_screen/mod.rs @@ -1265,7 +1265,7 @@ impl MainScreen { } /// Tell the core the user is typing in the session (throttled); it - /// postpones preparing a handoff (two minutes idle). + /// postpones preparing a handoff (four minutes idle). fn report_user_activity(&mut self, session_id: String, cx: &mut Context) { if !self .activity_reports diff --git a/crates/ui_gpui/src/settings_screen/general_section.rs b/crates/ui_gpui/src/settings_screen/general_section.rs index a51ea026..562ecccb 100644 --- a/crates/ui_gpui/src/settings_screen/general_section.rs +++ b/crates/ui_gpui/src/settings_screen/general_section.rs @@ -230,7 +230,7 @@ impl Render for GeneralSection { .text_color(cx.theme().muted_foreground) .child( "When a session whose last request had at least this many \ - input tokens stays idle for two minutes, the agent prepares \ + input tokens stays idle for four minutes, the agent prepares \ a /new prompt for a follow-up session while the prompt cache \ is still warm. 0 turns this off.", ), diff --git a/docs/handoff.md b/docs/handoff.md index bc4220a3..2cf3b585 100644 --- a/docs/handoff.md +++ b/docs/handoff.md @@ -104,7 +104,7 @@ so it never starts with consecutive user messages. ## Prepared handoff (idle) - **Arming**: when a run ends in which the agent answered in the session, - the core arms a per-session deadline of 2 minutes. A `/new` that only + the core arms a per-session deadline of 4 minutes. A `/new` that only opened an empty context or moved to a new session does not arm it. - **User activity**: frontends report typing in the viewed session via `SessionService::note_user_activity(session_id)`, throttled per session