mas-runtime needs a handful of package-wide defaults for values a manifest
is allowed to omit: the LLM model, the design pattern, and the context
manager. These are data, not Python constants, following the same pattern
as plugin aliases.
- Package defaults from src/mas/runtime/defaults.yaml.
- Workspace or user overrides from
config.yaml'sdefaults:block.
Overrides win on a per-key basis — a workspace can override just
design_pattern and still inherit the package's default model.
# config.yaml
defaults:
model: gpt-4.1-mini
design_pattern: cot@v1
context_manager: stackThis is validated against
src/mas/runtime/defaults.schema.yaml
(and against the root config.schema.yaml, which declares the same three
keys under its own defaults: property).
modelis exposed viamas.runtime.agent_defaults.default_model()/resolve_default_model(workspace=None), and is not a registry plugin type — it's a plain string consumed directly by callers that need an LLM model id (e.g.mas-ctl'sresolve_model_name).design_patternandcontext_managerare registry spec keys: on startup,bootstrap.load_registry()readsdefaults.yaml(merged with anyconfig.yamloverride) viamas.runtime.registry.defaults. load_defaults()and callsPluginRegistry.set_default(spec_key, plugin_id)for each one.agent_defaults.default_pattern_plugin_id()anddefault_context_manager_id()then simply read those back viaPluginRegistry.default_for(spec_key)— there is exactly one source of truth for "what plugin does an omittedspec.design_patternresolve to."
A plugin manifest (library.yaml, or a split-out *.plugins.yaml) can
also declare its own defaults: block (see
plugin-registry-manifests.md) to set the
default for a type it introduces. That is scoped to a single manifest's
own plugin types and complements this mechanism, which is the runtime-wide
default for model, design_pattern, and context_manager.
- Keep default values in package data (
defaults.yaml), not in Python constants or registry bootstrap code. - When adding a new package-wide default key, add it to both
defaults.schema.yaml'sspecproperties andconfig.schema.yaml'sdefaultsproperties, and decide whether it needs a registryset_default()call inbootstrap.load_registry()(only spec keys that are also registry plugin types do) or just a plain accessor (likemodel). agent_defaults.py's public API isdefault_model(),resolve_default_model(workspace=None),default_pattern_plugin_id(), anddefault_context_manager_id().