Skip to content

resolveSubagentModel

resolveSubagentModel(ctx, gadgetName, runtimeModel, defaultModel): string

Defined in: utils/config-resolver.ts:164

Convenience function for resolving subagent model with “inherit” support.

This is the most common resolution pattern for subagent gadgets:

  • Use runtime model if provided
  • Check subagent config for model override
  • Inherit parent model if configured
  • Fall back to default

ExecutionContext

ExecutionContext from gadget execution

string

Name of the subagent gadget

Model from gadget parameters

string | undefined

string

Default model if nothing else specified

string

Resolved model string

const model = resolveSubagentModel(ctx, "BrowseWeb", params.model, "sonnet");