Summary
Every agent turn currently ships the full 113-tool registry in the system prompt as JSON-schema, regardless of whether the operator's prompt is "what are the logs at?" (zero tools needed) or "delete file X" (one filesystem tool needed). At ~150 tokens of spec per tool, that's ~17,000 tokens of tool definitions on every single turn before the operator's question is even processed.
For openai-codex (gpt-5.3-codex, gpt-5.4-mini), that adds noticeable upload time, server-side parse time, and per-turn dollar cost. For local models on Ollama, it slows context build by hundreds of milliseconds and pushes context window usage.
Evidence
[tony-stark] telemetry: tools=113 on every turn
- subctl, doing a comparable OAuth + 1-tool turn, completes in ~3s — likely because it registers a much smaller set of tools per session.
- For Argent: model time was 7.7s on a turn where only
memory_recall + memory_timeline were used. The other 111 tool specs were paid for in tokens and time but never used.
Proposed fix (in order of complexity)
- Toolkit gating (cheapest): per-agent operator config picks which toolkits to register. Operator who never uses Composio's GitHub tools can disable that toolkit and shave its specs out. Some scaffolding for this already exists per
preferComposio work — extend it to all toolkits.
- Intent classification (medium): pre-classify the operator's prompt with a small local model into intent buckets (filesystem / memory / web / scheduling / chat-only / etc.) and only inject the relevant toolkit's specs. Bucket "chat-only" gets zero tools.
- Recency-weighted retrieval (advanced): rank tools by recent usage within this session + similarity to the prompt, and inject only the top-K.
Option 1 + a sane default-disabled set for most toolkits would likely cut the typical turn from 113 tools to 10-20 tools (-85% prompt block). Option 2 + 1 together would get most turns to <5 tools.
Acceptance criteria
Related
🤖 Filed from a live perf investigation.
Summary
Every agent turn currently ships the full 113-tool registry in the system prompt as JSON-schema, regardless of whether the operator's prompt is "what are the logs at?" (zero tools needed) or "delete file X" (one filesystem tool needed). At ~150 tokens of spec per tool, that's ~17,000 tokens of tool definitions on every single turn before the operator's question is even processed.
For openai-codex (
gpt-5.3-codex,gpt-5.4-mini), that adds noticeable upload time, server-side parse time, and per-turn dollar cost. For local models on Ollama, it slows context build by hundreds of milliseconds and pushes context window usage.Evidence
[tony-stark]telemetry:tools=113on every turnmemory_recall+memory_timelinewere used. The other 111 tool specs were paid for in tokens and time but never used.Proposed fix (in order of complexity)
preferComposiowork — extend it to all toolkits.Option 1 + a sane default-disabled set for most toolkits would likely cut the typical turn from 113 tools to 10-20 tools (-85% prompt block). Option 2 + 1 together would get most turns to <5 tools.
Acceptance criteria
[tony-stark]tools=Ntelemetry reflects the per-turn injected count, not the registry size.Related
🤖 Filed from a live perf investigation.