Add agent context compaction

This commit is contained in:
Georg Bauer
2026-07-26 10:48:29 +02:00
parent 1dcadeb882
commit 6aa45b2cf0
12 changed files with 625 additions and 2 deletions

View File

@@ -94,6 +94,8 @@ pub(crate) struct App {
#[cfg(target_os = "macos")]
active_generation: Option<ActiveGeneration>,
#[cfg(target_os = "macos")]
active_compaction: Option<generation::CompactionRequest>,
#[cfg(target_os = "macos")]
agent_tools: Option<(i32, Arc<Mutex<crate::agent::Tools>>)>,
#[cfg(target_os = "macos")]
active_tools: Option<crate::agent::ActiveTools>,
@@ -104,6 +106,9 @@ pub(crate) struct App {
#[cfg(target_os = "macos")]
_endpoint: Option<crate::server::ServerHandle>,
error: Option<String>,
pub(super) activity: Option<String>,
#[cfg(target_os = "macos")]
skip_compaction_once: bool,
}
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
@@ -295,6 +300,8 @@ impl App {
#[cfg(target_os = "macos")]
active_generation: None,
#[cfg(target_os = "macos")]
active_compaction: None,
#[cfg(target_os = "macos")]
agent_tools: None,
#[cfg(target_os = "macos")]
active_tools: None,
@@ -314,6 +321,9 @@ impl App {
None
}
},
activity: None,
#[cfg(target_os = "macos")]
skip_compaction_once: false,
}
}
Err(error) => Self::failed(
@@ -384,6 +394,8 @@ impl App {
#[cfg(target_os = "macos")]
active_generation: None,
#[cfg(target_os = "macos")]
active_compaction: None,
#[cfg(target_os = "macos")]
agent_tools: None,
#[cfg(target_os = "macos")]
active_tools: None,
@@ -397,6 +409,9 @@ impl App {
Some(service_error) => format!("{error} {service_error}"),
None => error,
}),
activity: None,
#[cfg(target_os = "macos")]
skip_compaction_once: false,
}
}