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
+3 -3
View File
@@ -74,12 +74,12 @@ class ToolCallPiece:
``id`` is the model's tool_call id (synthesized as ``call_<index>``
when the wire never carried one), ``name`` is the function name
(whatever the caller's ``tools`` list names — for the agent loop,
``list_documents`` / ``read_document``), and ``arguments`` is the
``ls`` / ``read`` / ``grep``, phase 70), and ``arguments`` is the
parsed JSON object (``{}`` when the model sent none).
"""
id: str # the model's tool_call id; synthesized "call_<index>" when absent
name: str # "list_documents" | "read_document" (whatever AGENT_TOOLS names)
name: str # "ls" | "read" | "grep" (whatever AGENT_TOOLS names, phase 70)
arguments: dict[str, Any]
@@ -124,7 +124,7 @@ def _materialize_tool_calls(
Malformed ``arguments`` JSON raises :class:`LLMError` — a silently
dropped tool call would corrupt the agent loop (fail-loud house
style). Empty/``null`` arguments become ``{}`` (a no-parameter call
such as ``list_documents``).
such as an unscoped ``ls``).
"""
pieces: list[ToolCallPiece] = []
for index in sorted(slots):