Back to catalog / Agent workflows
Fix a failing test fixture and verify independently
Iterate on failing tests in a locked-down fixture, then rerun assertions outside the agent session.
Goal
Have an agent fix known defects and confirm the final files pass the original tests without over-editing.
Steps
- Upload source and test files separately and create an environment with
networking: {"type":"limited"}; mounted uploads are read-only. [iterate] - Use
agent_toolset_20260401for the test/read-traceback/edit/rerun loop; fix the failing assertion instead of weakening tests. [iterate] - After the run, execute the full suite outside the session and inspect the final diff; the example independently reruns
pytest. [iterate]
How to verify
External tests pass, the diff is limited to the defect, and the read-only mounted originals remain unchanged.
Troubleshooting
If the same failure repeats, confirm the agent copied read-only mounts to a writable directory; `session idle` is not a passing test.
Permissions
Prerequisites
- Python 3.11+, an Anthropic API key, the SDK, and a disposable source/pytest fixture.
Permissions
- Use a secret-free test repository; disable arbitrary outbound networking and confine tools to the sandbox.
Limitations
Agent-run tests are not independent verification; trusted CI must rerun them before merge or release.
Pinned upstream source
- Repository
- anthropics/anthropic-cookbook
- File path
- managed_agents/CMA_iterate_fix_failing_tests.ipynb
- Pinned commit
9c1e493ddd2b82df399d2a61b9c806c539e18be6- Source checked
- 2026-10-14 · Reviewed against the pinned upstream source
Repository metrics
These values describe the upstream repository, not popularity or likes for an individual skill or playbook.
- Stars
- Not collected
- Forks
- Not collected
- Observed at
- Not collected
No metrics snapshot is available yet.
License: MIT
Main topic
Take a coding Agent change from context to verification