Expose your subagent as a plain tool owned by the main loop: it runs in a fresh, disposable context window with strictly read-only tools and hands back only a compact factual summary.
以后每加一个新 Skill、或把某个子代理折叠回主循环,先跑一遍 uv run pytest tests/test_evals.py——用分数说话,不再凭感觉拍脑袋!
EN
Before adding a new skill or folding a subagent into the main loop, run uv run pytest tests/test_evals.py to prove quality didn’t regress:
1 2 3 4 5 6 7 8 9 10 11 12
# tests/test_evals.py import pytest
deftest_skill_loaded_on_demand(harness_runner) -> None: res = harness_runner("帮我检查 `CREATE INDEX idx_a ON orders(user_id);` 线上执行有没有风险") tools_used = [t["tool"] for t in res["trace"]] assert"load_skill"in tools_used assert"CONCURRENTLY"in res["answer"]