providers: the provider follows the model, not the agent
Subconscious, reflection and archivist each pick a model independently of the primary, then took the primary's provider to run it on. A subconscious on deepseek-v4-flash under a claude-subscription primary was sent to api.anthropic.com asking for a model it has never heard of, so a split like Opus-5 primary with a DeepSeek subconscious could not work at all. ProviderRegistry now carries the [models.<name>] provider map and resolves by model, falling back to the agent's provider when a model has no entry — the single-provider case every agent used before.
This commit is contained in:
parent
eee26fcf57
commit
30e1c34a34
4 changed files with 53 additions and 13 deletions
|
|
@ -208,13 +208,20 @@ impl ArchivistEngine {
|
|||
let approx_tokens_compressed = raw.len() / 4;
|
||||
|
||||
let model = self.resolve_model(agent_id).await;
|
||||
let llm: Arc<dyn LlmProvider> = self
|
||||
.agents
|
||||
.get(agent_id)
|
||||
.await
|
||||
.ok()
|
||||
.map(|a| self.providers.for_agent(&a))
|
||||
.unwrap_or_else(|| self.providers.default_provider());
|
||||
// Provider follows the model. The compression model is frequently on
|
||||
// another provider entirely (a gateway-hosted model while the agent
|
||||
// runs on a direct wire), so taking the agent's provider sent it to an
|
||||
// endpoint that has never heard of that model.
|
||||
let llm: Arc<dyn LlmProvider> = match self.providers.for_model(&model) {
|
||||
Some(llm) => llm,
|
||||
None => self
|
||||
.agents
|
||||
.get(agent_id)
|
||||
.await
|
||||
.ok()
|
||||
.map(|a| self.providers.for_agent(&a))
|
||||
.unwrap_or_else(|| self.providers.default_provider()),
|
||||
};
|
||||
let synthesis = self
|
||||
.run_synthesis(&llm, &model, &raw, start_date, end_date)
|
||||
.await?;
|
||||
|
|
|
|||
Loading…
Reference in a new issue