Watch
1
0
Fork
You've already forked souveraine
0
souveraine/saf/per-agent-compaction-provider.md
Fimeg 3ff6ffaa7f license: relicense AGPL-3.0; bring SAF docs online; keep CLAUDE.md + docs/ local
SAF (souveraine architecture files) is now the in-repo doc set. working notes
(CLAUDE.md, docs/) stay on disk, gitignored.
2026-06-19 10:17:56 -04:00

871 B

Per-agent provider resolution in compaction engine

Status: pending

Compaction currently resolves via ProviderRegistry::default_provider() (src/core/compact/mod.rs:154,181). It doesn't have access to AgentInventory to load AgentState for per-agent resolution — it uses closure-based dependency injection (get_messages, replace_messages, get_repo, get_agent_type).

What needs doing

Add a get_agent: Arc<dyn Fn(&str) -> Option<AgentState> + Send + Sync> closure (or pass Arc<AgentInventory> directly) so the Summary and SlidingReflect strategy branches can call providers.for_agent(&agent_state) instead of providers.default_provider().

Why

Agents routed through a non-default provider (e.g. Vanguard → z.ai) will fall back to Bifrost during compaction, which may fail if Bifrost's virtual key doesn't permit the agent's model.