Skip to content

resolveValue

resolveValue<T>(ctx, gadgetName, options): T

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

Resolve a single configuration value through the priority chain.

Priority (highest to lowest):

  1. Runtime parameter (if provided and not undefined)
  2. Subagent config (from ctx.subagentConfig[gadgetName][key])
  3. Parent config (from ctx.agentConfig[key], if parentKey specified)
  4. Default value

Special handling for “inherit” string:

  • If handleInherit is true and value is “inherit”, falls through to parent/default

T

ExecutionContext

ExecutionContext from gadget execution

string

Name of the subagent gadget (e.g., “BrowseWeb”)

ResolveValueOptions<T>

Resolution options

T

Resolved value

const model = resolveValue(ctx, "BrowseWeb", {
runtime: params.model,
subagentKey: "model",
parentKey: "model",
defaultValue: "sonnet",
handleInherit: true,
});