Repository navigation
fix(skills): teach the coding skill the pytest spelling that actually works - #4174
Conversation
… works The gate accepts `python -m pytest`, but the coding skill the agent reads shows bare `pytest` only — so it keeps typing the spelling that fails to import the project on a checkout that was never installed, and works around it by writing a config file into the repository. The refusal for `PYTHONPATH=. pytest` had the same gap: it named the inline assignment and said to drop it, which walks back into the import error. It now names `python -m pytest`. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Verdict: Request changes — the skill half of this PR is a genuine improvement; the error-message half contradicts what the shell gate actually does today. Teaching the coding skill to prefer Two smaller gaps in the new skill text:
Real-world evidenceNo 🔍 Technical details🟡 The edited hint describes behavior the gate no longer has, on an unreachable branch (
|
Review follow-up. The refusal hint I edited described inline `VAR=value` commands as unsupported and steered the agent away from `PYTHONPATH=. pytest` — but main now lifts leading assignments before that check, so the branch is unreachable and the advice contradicted what works. The edit is reverted. The skill text gains the two cases it missed: `python -m` adds the current directory, not `src/`, so a src-layout project needs `PYTHONPATH=src python -m pytest`; and `python3 -m pytest` where only `python3` exists. All three spellings are allowed under the coding skill's pytest grant. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The coding skill grants `pytest` and tells the model to run the tests, but it didn't list the one tool that can run a shell command. Once loading a skill brings in the tools it declares, the model got every coding tool except the one that runs tests. The skill now declares that tool. A new starter-pack check fails any skill whose shell grant has no tool to use it. Coding was the only skill that broke the rule; `github-triage` already declared the tool. Overlaps amd#3390 and amd#4174, which both edit the same `pytest` paragraph and neither adds the tool. Whichever merges second needs a one-line rebase. ## Test plan - [x] `python -m pytest tests/unit/test_starter_skills.py -q -k shell_grant`: the new check fails for `coding` before the fix and passes for all 16 skills after it - [x] `python -m pytest tests/unit/test_starter_skills.py tests/unit/test_skill_binary_grants.py hub/agents/gaia/python/tests/test_gaia_agent.py -q`: 489 passed. The one failure, `test_manifest_tools_count_matches_real_registry` (81 vs 80), counts the agent's tool registry, which this change doesn't touch - [x] `black --check` / `isort --check-only` on the changed test file - [ ] `gaia eval agent`: the loaded coding skill now gives the model an extra tool Fixes amd#4222 Co-authored-by: Kalin Ovtcharov <[email protected]> Co-authored-by: Kalin Ovtcharov <[email protected]>
On a checkout that was never pip-installed, bare
pytestcannot import the project — so the agent's test run fails, and its usual way out is to write a config file into your repository to make the import work. The gate already acceptspython -m pytest, which has the same grant and the same flag rules and needs no such workaround, but the skill the agent actually reads only ever showed the spelling that fails.The refusal for
PYTHONPATH=. pytesthad the same gap: it correctly named the inline assignment as unsupported and then said to drop it, which walks straight back into the import error. It now names the spelling that works.Test plan
pytest tests/unit -k "skill_binary or shell_guardrails or starter_skill or pytest_grant"— 591 passed, 80 skipped.python -m pytestis already mapped to the pytest grant (src/gaia/skills/binaries.py), so this changes guidance only, not policy.🤖 Generated with Claude Code