From 499fd172f96a7509424c2e3748f6d0ae843176cf Mon Sep 17 00:00:00 2001 From: Trecek Date: Sun, 3 May 2026 23:47:33 -0700 Subject: [PATCH 1/2] feat(recipe): add RecipeStep.provider field and sync io.py parsing Add nullable provider: str | None = None field to RecipeStep after the model field in schema.py. Update _PARSE_STEP_HANDLED_FIELDS and _parse_step() constructor call in io.py atomically to keep the import-time field-set guard satisfied. Add tests for provider extraction and absent case. Co-Authored-By: Claude Sonnet 4.6 --- src/autoskillit/recipe/io.py | 2 ++ src/autoskillit/recipe/schema.py | 1 + tests/recipe/test_io.py | 8 ++++++++ 3 files changed, 11 insertions(+) diff --git a/src/autoskillit/recipe/io.py b/src/autoskillit/recipe/io.py index 0b3cc349d4..ad7be3da33 100644 --- a/src/autoskillit/recipe/io.py +++ b/src/autoskillit/recipe/io.py @@ -154,6 +154,7 @@ def find_recipe_by_name(name: str, project_dir: Path) -> RecipeInfo | None: "optional", "skip_when_false", "model", + "provider", "description", "sub_recipe", "gate", @@ -264,6 +265,7 @@ def _parse_step(data: dict[str, Any]) -> RecipeStep: optional=bool(data.get("optional", False)), skip_when_false=data.get("skip_when_false"), model=data.get("model"), + provider=data.get("provider"), description=data.get("description", ""), sub_recipe=data.get("sub_recipe"), gate=data.get("gate"), diff --git a/src/autoskillit/recipe/schema.py b/src/autoskillit/recipe/schema.py index 259b137a7b..7391da306b 100644 --- a/src/autoskillit/recipe/schema.py +++ b/src/autoskillit/recipe/schema.py @@ -84,6 +84,7 @@ class RecipeStep: optional: bool = False skip_when_false: str | None = None model: str | None = None + provider: str | None = None description: str = "" sub_recipe: str | None = None # Name of sub-recipe file (no extension) gate: str | None = None # Ingredient name whose value controls lazy loading diff --git a/tests/recipe/test_io.py b/tests/recipe/test_io.py index 7b852f5b48..6c44228e2a 100644 --- a/tests/recipe/test_io.py +++ b/tests/recipe/test_io.py @@ -433,6 +433,14 @@ def test_parse_step_model_absent(self) -> None: step = _parse_step({"tool": "run_skill"}) assert step.model is None + def test_parse_step_extracts_provider(self) -> None: + step = _parse_step({"tool": "run_skill", "provider": "anthropic"}) + assert step.provider == "anthropic" + + def test_parse_step_provider_absent(self) -> None: + step = _parse_step({"tool": "run_skill"}) + assert step.provider is None + def test_parse_step_reads_stale_threshold(self) -> None: data = {"tool": "run_skill", "stale_threshold": 2400, "on_success": "done"} step = _parse_step(data) From 5a7c8ff7c61dee44a9485de1fc370ca60b8dec6a Mon Sep 17 00:00:00 2001 From: Trecek Date: Sun, 3 May 2026 23:56:35 -0700 Subject: [PATCH 2/2] fix(test): isolate test_sigterm_writes_scenario_json from user home config Subprocess spawned by the test inherited HOME and loaded ~/.autoskillit/config.yaml, which contained an unrecognized 'features' key that ConfigSchemaError rejected before the server could start. Set HOME to tmp_path/home so the subprocess sees a clean env. --- tests/execution/test_recording_sigterm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/execution/test_recording_sigterm.py b/tests/execution/test_recording_sigterm.py index 0aaa21276c..df10306db9 100644 --- a/tests/execution/test_recording_sigterm.py +++ b/tests/execution/test_recording_sigterm.py @@ -29,8 +29,11 @@ def test_sigterm_writes_scenario_json(tmp_path): output_dir = tmp_path / "scenario" output_dir.mkdir() + fake_home = tmp_path / "home" + fake_home.mkdir() env = { **os.environ, + "HOME": str(fake_home), "RECORD_SCENARIO": "1", "RECORD_SCENARIO_DIR": str(output_dir), "RECORD_SCENARIO_RECIPE": "test-recipe",