You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TOOL_SCHEMAS in repi/investigation/tools.py is verbose by design — each tool has a multi-line description teaching the LLM when and how to call it (scan_window's description alone is ~10 lines). That's correct and necessary on the first iteration: the model has never seen these tools before. On every subsequent iteration the same description is replayed verbatim in the system / user prompt and contributes nothing — the model has already used the tools, the schemas no longer teach.
On a 10-iteration investigation this is a measurable token cost. With message compaction (#12) handling observation growth, schema repetition becomes the next biggest source of avoidable tokens.
Scope (in)
After iteration 1, emit a compact form of the schemas: tool name + arg names + arg types only. Drop the prose descriptions and the long usage notes.
The compact form should still be enough for the model to look up an arg name if it forgets; it just doesn't re-teach behaviour.
Iteration 1 keeps the full schemas — never strip on the first turn.
Why
TOOL_SCHEMASinrepi/investigation/tools.pyis verbose by design — each tool has a multi-line description teaching the LLM when and how to call it (scan_window's description alone is ~10 lines). That's correct and necessary on the first iteration: the model has never seen these tools before. On every subsequent iteration the same description is replayed verbatim in the system / user prompt and contributes nothing — the model has already used the tools, the schemas no longer teach.On a 10-iteration investigation this is a measurable token cost. With message compaction (#12) handling observation growth, schema repetition becomes the next biggest source of avoidable tokens.
Scope (in)
compare_services) gets its full schema the first time it appears, then collapses.Scope (out)
Acceptance
tests/investigation/test_react_loop.pyasserts the compact schema form is emitted for iterations >= 2.Files
repi/investigation/react_loop.py— prompt assembly.repi/investigation/tools.py— possibly acompact_schema()helper.tests/investigation/test_react_loop.pyDepends on
#12 (message compaction) — orthogonal but lands in the same code path; coordinate to avoid merge churn.