diff --git a/pkg/invoke/invoker.go b/pkg/invoke/invoker.go index 1b519ec4..d62b4e5a 100644 --- a/pkg/invoke/invoker.go +++ b/pkg/invoke/invoker.go @@ -26,7 +26,6 @@ import ( "github.com/otto8-ai/otto8/pkg/wait" apierror "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/fields" "k8s.io/client-go/util/retry" kclient "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -289,32 +288,9 @@ func (i *Invoker) Agent(ctx context.Context, c kclient.WithWatch, agent *v1.Agen } } - defaultModel := agent.Spec.Manifest.Model - if defaultModel == "" { - var models v1.ModelList - if err := c.List(ctx, &models, &kclient.ListOptions{ - FieldSelector: fields.SelectorFromSet(map[string]string{ - "spec.manifest.default": "true", - }), - Namespace: agent.Namespace, - }); err != nil { - return nil, err - } - - if len(models.Items) > 0 { - for _, model := range models.Items { - if model.Spec.Manifest.Active { - defaultModel = model.Name - break - } - } - } - } - return i.createRun(ctx, c, thread, tools, input, runOptions{ Synchronous: opt.Synchronous, AgentName: agent.Name, - DefaultModel: defaultModel, Env: extraEnv, CredentialContextIDs: credContextIDs, WorkflowStepName: opt.WorkflowStepName, @@ -336,7 +312,6 @@ type runOptions struct { ForceNoResume bool Env []string CredentialContextIDs []string - DefaultModel string } var ( @@ -385,7 +360,7 @@ func (i *Invoker) createRun(ctx context.Context, c kclient.WithWatch, thread *v1 Tool: string(toolData), Env: opts.Env, CredentialContextIDs: opts.CredentialContextIDs, - DefaultModel: opts.DefaultModel, + DefaultModel: string(types.DefaultModelAliasTypeLLM), }, }