feat: add instance config provider and map storage ids

This commit is contained in:
Shantur Rathore
2025-11-20 14:46:13 +00:00
parent 038cf3c762
commit 3f46d73a31
14 changed files with 247 additions and 131 deletions

View File

@@ -32,13 +32,6 @@ async function getDefaultModel(
const instanceProviders = providers().get(instanceId) || []
const instanceAgents = agents().get(instanceId) || []
if (agentName) {
const stored = getAgentModelPreference(instanceId, agentName)
if (isModelValid(instanceId, stored)) {
return stored
}
}
if (agentName) {
const agent = instanceAgents.find((a) => a.name === agentName)
if (agent && agent.model && isModelValid(instanceId, agent.model)) {
@@ -47,6 +40,11 @@ async function getDefaultModel(
modelId: agent.model.modelId,
}
}
const stored = await getAgentModelPreference(instanceId, agentName)
if (isModelValid(instanceId, stored)) {
return stored
}
}
const recent = getRecentModelPreferenceForInstance(instanceId)