fix(desktop): stop pinning agents to deprecated SPROUT_ACP_TURN_TIMEOUT (#592)

Signed-off-by: Tyler Longwell <109685178+tlongwell-block@users.noreply.github.com>
This commit is contained in:
tlongwell-block
2026-05-14 21:51:38 -04:00
committed by GitHub
parent 5cdb3062ed
commit 13dc0df688
2 changed files with 13 additions and 7 deletions
@@ -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
@@ -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;