Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/webwright/skill_factory/route.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import os
import subprocess
import sys
from pathlib import Path

from .execute import run_skill
from .gate import gate
Expand Down Expand Up @@ -61,7 +62,7 @@ def agent_cfg(cfg: list[str]) -> list[str]:
# -c REPLACES the defaults; base.yaml carries the agent's system/instance templates, so
# re-add it unless a base was named — otherwise `-c model.yaml` alone yields an agent with
# no template (a cryptic pydantic ValidationError, not a helpful message).
if not any("base" in c for c in cfg):
if not any(Path(c).name == "base.yaml" for c in cfg):
cfg = ["base.yaml", *cfg]
return cfg
over = [f"model.{key}={val}" for key, val in
Expand Down
8 changes: 8 additions & 0 deletions tests/skill_factory/test_build_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,14 @@ def test_bare_model_config_gets_base_prepended():
["base.yaml", "m.yaml", "model.max_output_tokens=16000"]


def test_base_is_matched_on_the_filename_not_a_substring():
"""`base` in `database.yaml` is not a base config. Prepend base.yaml so the agent
still gets system/instance templates."""
assert agent_cfg(["database.yaml"]) == ["base.yaml", "database.yaml"]
assert agent_cfg(["my_base_model.yaml"]) == ["base.yaml", "my_base_model.yaml"]
assert agent_cfg(["configs/base.yaml", "mine.yaml"]) == ["configs/base.yaml", "mine.yaml"]


def test_the_env_path_carries_a_usable_output_budget(monkeypatch):
"""The env path stands in for a model yaml, which set max_output_tokens: 16000. base.yaml's
4000 truncates the agent mid-script when it reuses a big skill, and the run loops re-emitting
Expand Down