test: subagents get AGENTS.md in system prompt; general prompt asks for a check after edits

Closes #156
This commit is contained in:
hermes committed 2026-10-15 20:34:53 +00:00
1 parent 170cde70a9
commit 59d7ed8252
2 files changed
+5 -1

No files matched your search

+4
View File
@@ -9,6 +9,7 @@ mkdir -p "$tmp/home/.hx" "$tmp/repo"
echo '{"claude":{"access":"fake-token","refresh":"r","expires":99999999999999}}' > "$tmp/home/.hx/auth.json"
printf '[lsp]\nmode = "off"\ntests = "off"\n' > "$tmp/home/.hx/config.toml"
echo "secret is 42" > "$tmp/repo/note.txt"
echo "PROJECT-RULE-XYZ" > "$tmp/repo/AGENTS.md"
cat > "$tmp/turns.json" <<'J'
[[["tool_use", {"id": "p1", "name": "Task", "input": {"prompt": "what is in note.txt?"}}]],
[["tool_use", {"id": "c1", "name": "Read", "input": {"path": "note.txt"}}]],
@@ -33,6 +34,9 @@ assert "haiku" in child1["model"] and "sonnet" in parent["model"], (child1["mode
assert child1["messages"][0]["content"][0]["text"] == "what is in note.txt?"
assert {t["name"] for t in child1["tools"]} == {"Read", "Bash", "skill"}, [t["name"] for t in child1["tools"]]
assert "Task" in {t["name"] for t in parent["tools"]}
# children get the project context (AGENTS.md) in their system prompt, like the parent
for r in (parent, child1, child2):
assert "PROJECT-RULE-XYZ" in json.dumps(r["system"]), r["model"]
# parent got only the child's answer (+ stats line), not the Read result
res = json.dumps(parent2["messages"][-1])
assert "secret is 42" in res and "[task explore" in res