fix(agent): route media turns to image models and embed onboard workspace
This commit is contained in:
1 parent
c362114cf1
commit
9fd0dbda96
6 files changed
+435
-85
No files matched your search
@@ -43,6 +43,7 @@ type AgentInstance struct {
|
||||
SkillsFilter []string
|
||||
MCPServerAllowlist map[string]struct{}
|
||||
Candidates []providers.FallbackCandidate
|
||||
ImageCandidates []providers.FallbackCandidate
|
||||
|
||||
// Router is non-nil when model routing is configured and the light model
|
||||
// was successfully resolved. It scores each incoming message and decides
|
||||
@@ -198,9 +199,19 @@ func NewAgentInstance(
|
||||
|
||||
// Resolve fallback candidates
|
||||
candidates := resolveModelCandidates(cfg, defaults.Provider, model, fallbacks)
|
||||
imageCandidates := resolveModelCandidates(
|
||||
cfg,
|
||||
defaults.Provider,
|
||||
defaults.ImageModel,
|
||||
defaults.ImageModelFallbacks,
|
||||
)
|
||||
|
||||
candidateProviders := make(map[string]providers.LLMProvider)
|
||||
populateCandidateProvidersFromNames(cfg, workspace, fallbacks, candidateProviders)
|
||||
if strings.TrimSpace(defaults.ImageModel) != "" {
|
||||
imageNames := append([]string{defaults.ImageModel}, defaults.ImageModelFallbacks...)
|
||||
populateCandidateProvidersFromNames(cfg, workspace, imageNames, candidateProviders)
|
||||
}
|
||||
|
||||
// Model routing setup: pre-resolve light model candidates at creation time
|
||||
// to avoid repeated model_list lookups on every incoming message.
|
||||
@@ -265,6 +276,7 @@ func NewAgentInstance(
|
||||
SkillsFilter: skillsFilter,
|
||||
MCPServerAllowlist: agentMCPServerAllowlist,
|
||||
Candidates: candidates,
|
||||
ImageCandidates: imageCandidates,
|
||||
Router: router,
|
||||
LightCandidates: lightCandidates,
|
||||
LightProvider: lightProvider,
|
||||
|
||||
Reference in new issue
Block a user