feat: unified exec basic pruning strategy (#7239)

LRU + exited sessions first
This commit is contained in:
jif-oai
2025-11-24 18:22:32 +01:00
committed by GitHub
Unverified
parent 920239f272
commit b2cddec3d7
3 changed files with 286 additions and 3 deletions
+2
View File
@@ -46,6 +46,7 @@ pub(crate) const MAX_YIELD_TIME_MS: u64 = 30_000;
pub(crate) const DEFAULT_MAX_OUTPUT_TOKENS: usize = 10_000;
pub(crate) const UNIFIED_EXEC_OUTPUT_MAX_BYTES: usize = 1024 * 1024; // 1 MiB
pub(crate) const UNIFIED_EXEC_OUTPUT_MAX_TOKENS: usize = UNIFIED_EXEC_OUTPUT_MAX_BYTES / 4;
pub(crate) const MAX_UNIFIED_EXEC_SESSIONS: usize = 64;
pub(crate) struct UnifiedExecContext {
pub session: Arc<Session>,
@@ -108,6 +109,7 @@ struct SessionEntry {
command: Vec<String>,
cwd: PathBuf,
started_at: tokio::time::Instant,
last_used: tokio::time::Instant,
}
pub(crate) fn clamp_yield_time(yield_time_ms: u64) -> u64 {