Commit b097547
perf: optimize doc-maintainer token usage (~27% reduction) (#1645)
Implements recommendations from token optimization issue #1643:
1. Remove unused github: toolset — the agent uses bash for all git/file
ops and safeoutputs for PR creation. The 22 GitHub MCP tools were
loaded but never called, adding ~13,200 tokens/turn to the system
prompt. Estimated savings: ~422K tokens/run (~14%).
2. Pre-compute git changes and doc file list in steps: block — eliminates
the agent's discovery phase (3-5 turns of running git log, find).
Step outputs are injected into the prompt via template variables.
Estimated savings: ~190K tokens/run (~8%).
3. max-turns guard — not implemented because the copilot engine does not
support this feature. The existing timeout-minutes: 15 serves as the
cost cap.
Expected impact: ~$3.91 → ~$2.55/run (-35% cost), 3,003K → ~2,200K
tokens/run (-27%), 22 → 0 GitHub tools loaded (-100%).
Closes #1643
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent cba0f2c commit b097547
2 files changed
Lines changed: 539 additions & 434 deletions
0 commit comments