mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-26 04:25:46 +02:00
fix(core): rebuild system prompt after provider switch
setProvider() updated the resolved provider and model but did not rebuild the system prompt, so the runtime info line still showed the old provider/model (e.g. claude-code/claude-opus-4-6) after switching. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -905,6 +905,14 @@ export class Agent {
|
||||
contextWindowTokens: this.contextWindowGuard.tokens,
|
||||
});
|
||||
|
||||
// Rebuild system prompt so runtime info reflects the new provider/model
|
||||
const toolNames = (this.agent.state.tools ?? []).map((t: { name: string }) => t.name);
|
||||
const systemPrompt = this.rebuildSystemPrompt(toolNames);
|
||||
if (systemPrompt) {
|
||||
this.agent.setSystemPrompt(systemPrompt);
|
||||
this.session.setSystemPrompt(systemPrompt);
|
||||
}
|
||||
|
||||
return {
|
||||
provider: providerId,
|
||||
model: model.id,
|
||||
|
||||
Reference in New Issue
Block a user