feat(agent): align the document tools with the harness-trained shape — ls, read(path), grep(pattern, path?)

This commit is contained in:
2026-09-03 11:17:47 -04:00
parent 16f1cfbcaf
commit 801639efcc
55 changed files with 4031 additions and 1466 deletions
+10 -1
View File
@@ -578,10 +578,16 @@ def test_endpoint_grounded_turn_runs_agent_loop_with_tools(
assert not any(f["type"] == "tool" for f in frames)
assert len(llm.seen) == 1
assert llm.seen_tools == [AGENT_TOOLS] # one request, tools offered
# The system prompt is the HIGH prompt with the <tools> instructions.
# The system prompt is the HIGH prompt with the <tools> instructions
# (phase 70: the harness-aligned ls/read/grep copy — new names in,
# old phase-37/68 names out).
(system, _user) = llm.seen[0][0], llm.seen[0][1]
assert "<relevance>HIGH</relevance>" in system["content"]
assert "<tools>" in system["content"]
for tool in ("`ls`", "`grep`", "`read`"):
assert tool in system["content"]
for old in ("list_documents", "read_document", "search_documents"):
assert old not in system["content"]
def test_endpoint_deflected_turn_never_offers_tools(
@@ -605,6 +611,9 @@ def test_endpoint_deflected_turn_never_offers_tools(
assert llm.seen_tools == [None]
(system, _user) = llm.seen[0][0], llm.seen[0][1]
assert "<tools>" not in system["content"] # the LOW prompt never carries it
# Phase 70: the rewritten <tools> copy stays out of the deflected path
# (the LOW prompt is byte-identical to the pre-phase text).
assert "You may extend your context with three tools" not in system["content"]
def test_endpoint_score_at_threshold_answers(