diff --git a/desktop/src-tauri/src/managed_agents/runtime.rs b/desktop/src-tauri/src/managed_agents/runtime.rs index 99dba8944..c9ded207e 100644 --- a/desktop/src-tauri/src/managed_agents/runtime.rs +++ b/desktop/src-tauri/src/managed_agents/runtime.rs @@ -559,14 +559,14 @@ pub fn spawn_agent_child( if known_acp_provider(&record.agent_command).is_some_and(|p| p.mcp_hooks) { command.env("MCP_HOOK_SERVERS", "*"); } + // Only emit SPROUT_ACP_IDLE_TIMEOUT when the user has explicitly set an + // override. When unset, the sprout-acp harness applies its own default + // (see `DEFAULT_IDLE_TIMEOUT_SECS` in crates/sprout-acp/src/config.rs), + // which is the single source of truth. The previously-emitted + // `SPROUT_ACP_TURN_TIMEOUT` is deprecated upstream and was pinning every + // agent to the desktop's stale default (320s), bypassing harness bumps. if let Some(idle) = record.idle_timeout_seconds { command.env("SPROUT_ACP_IDLE_TIMEOUT", idle.to_string()); - command.env("SPROUT_ACP_TURN_TIMEOUT", idle.to_string()); - } else { - command.env( - "SPROUT_ACP_TURN_TIMEOUT", - record.turn_timeout_seconds.to_string(), - ); } let max_dur = record diff --git a/desktop/src-tauri/src/managed_agents/types.rs b/desktop/src-tauri/src/managed_agents/types.rs index dc4bafecc..9027ad65b 100644 --- a/desktop/src-tauri/src/managed_agents/types.rs +++ b/desktop/src-tauri/src/managed_agents/types.rs @@ -386,7 +386,13 @@ pub struct UpdateTeamRequest { pub const DEFAULT_ACP_COMMAND: &str = "sprout-acp"; pub const DEFAULT_AGENT_COMMAND: &str = "goose"; pub const DEFAULT_MCP_COMMAND: &str = "sprout-mcp-server"; -/// ~5 min (320s) — matches the CLI harness default (SPROUT_ACP_IDLE_TIMEOUT). +/// Default for the legacy `turn_timeout_seconds` field on the agent record. +/// +/// As of the deprecation of `SPROUT_ACP_TURN_TIMEOUT` in sprout-acp, this +/// field is no longer wired into the spawn path — the harness owns the +/// effective idle-timeout default. The value is kept here only to satisfy +/// existing persisted records and the `CreateAgentDialog` form state. Prefer +/// `idle_timeout_seconds` (mapped to `SPROUT_ACP_IDLE_TIMEOUT`) for overrides. pub const DEFAULT_AGENT_TURN_TIMEOUT_SECONDS: u64 = 320; /// 1 hour — absolute wall-clock safety cap per turn. pub const DEFAULT_AGENT_MAX_TURN_DURATION_SECONDS: u64 = 3600;