mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 16:47:34 +00:00
* fix(memory): bound session and lifecycle registries * fix(memory): bound transient filesystem registries * fix(memory): cap path and locale caches * fix(memory): bound runtime recovery registries * fix(memory): bound host mirror gap verdicts * fix(memory): bound shell startup env cache * fix(memory): bound gitlab host context cache * fix(memory): release removed ssh generations * fix(memory): expire cloud refresh replay guards * fix(memory): release retired plugin generations * fix(memory): bound plugin log key retention * fix(memory): bound automation authority generations * fix(memory): bound native chat enrichment cache * fix(memory): bound web session tracking generations * fix(memory): bound codex credential absence paths * fix(memory): bound WSL canonical path cache * fix(memory): bound sparse checkout cache * fix(memory): bound shared directory cache * fix(memory): bound advertised URL scan snapshots * fix(memory): bound automation manager cache * fix(memory): bound web session reorder intents * fix(memory): bound web session focus intents * fix(memory): bound web session handoffs * fix(memory): bound automation dispatch tokens * fix(memory): bound host mirror waiters * fix(memory): bound retained session activity * fix(memory): bound retained session activity * fix(memory): bound web session close intents * fix(memory): bound cloud session cache * fix(memory): bound WSL home cache * fix(memory): bound SSH capability cache * fix(memory): bound trust grant cooldowns * fix(memory): bound WSL auth drain state * fix(memory): bound Linear workspace credential cache * fix(memory): bound local Git capability cache * fix(memory): bound WSL Git environment cache * fix(memory): bound WSL Git environment cache * fix(memory): bound WSL preflight cache * fix(memory): keep hot cache entries warm * fix(memory): preserve generation fences across eviction * fix(memory): close remaining eviction fences * fix(memory): align evicted upstream generations * fix(memory): trim successful capability probes * fix(auth): retain expired refresh replay evidence --------- Co-authored-by: m4air <m4air@Mac.localdomain>
28 lines
645 B
TypeScript
28 lines
645 B
TypeScript
export function prunePreflightWslCache(
|
|
cached: Map<string, { expiresAt: number }>,
|
|
latestRuns: Map<string, number>,
|
|
now: number,
|
|
maxEntries: number
|
|
): void {
|
|
for (const [key, entry] of cached) {
|
|
if (entry.expiresAt <= now) {
|
|
cached.delete(key)
|
|
}
|
|
}
|
|
while (cached.size > maxEntries) {
|
|
const oldest = cached.keys().next().value
|
|
if (oldest === undefined) {
|
|
break
|
|
}
|
|
cached.delete(oldest)
|
|
latestRuns.delete(oldest)
|
|
}
|
|
while (latestRuns.size > maxEntries) {
|
|
const oldest = latestRuns.keys().next().value
|
|
if (oldest === undefined) {
|
|
break
|
|
}
|
|
latestRuns.delete(oldest)
|
|
}
|
|
}
|