ADR 0029: Deferred Tool Schema Loading
Status
Accepted
Context
Agent tool catalogs can exceed practical LLM context limits when every tool schema is sent on each turn. ADR 0024 retired the Worker tool_search / run_deferred_task orchestration path but left full-schema exposure in the main turn pipeline.
Decision
- Always deferred — every turn exposes only
alwaysLoadedTools+ session-loaded tools to the model (Harness path). Catalog remains full for discovery. - Harness meta tools —
discover(kind)+load_tool+load_skill(replacesactivate_skill). - Session stickiness — loaded tool names stored in
ContextRepositorysession metadata with LRU (maxLoadedPerSession, default 12). - Anthropic native — when
sdk === 'anthropic', send full catalog withdeferLoadingon non-loaded tools and enableadvanced-tool-use-2025-11-20beta. - Config —
ai.agent.deferredTools.alwaysLoadedToolsreplacesorchestratorTools(auto-migrated byfix-ai-config). - Subagents — no
discover;spawn_task.tools[]/skills[]declare needs; subagents mayload_tool/load_skill.
Consequences
- Breaking:
activate_skillremoved (useload_skill). - Breaking:
orchestratorTools→deferredTools.alwaysLoadedTools. tool-selectionTF-IDF filtering bypassed for runtime catalog; discovery uses TF-IDF viadiscover.
Related
- ADR 0024 — prior orchestration retirement
docs/advanced/ai.md— Deferred Tools section