Summary
Replace the current approach of injecting all strategic documents into the agent's system prompt (push-based) with a tool that lets the agent read specific documents on demand (pull-based), reducing per-turn context size.
Problem / Context
The current prepareStep() in src/agent/orchestrator.ts injects memory entries filtered by category into every agent turn. With strategic docs (design.md at 15K tokens, implementation-plan.md at 15K tokens, guides totaling ~7K tokens), this adds ~37K tokens to every turn's context.
Over 180 turns, that's 6.7M tokens of repeated strategic doc content that the agent may only reference occasionally.
Proposed Solution
This was already implemented in commit 2d047b2 (feat(agent): replace push-based strategic docs with pull-based tool access). Verify the implementation is working correctly and producing the expected token savings.
The approach:
- Remove strategic doc injection from
prepareStep()
- Add a
readProjectDoc tool that lets the agent fetch specific docs when needed
- Agent's system prompt mentions available docs but doesn't include their content
Acceptance Criteria
Summary
Replace the current approach of injecting all strategic documents into the agent's system prompt (push-based) with a tool that lets the agent read specific documents on demand (pull-based), reducing per-turn context size.
Problem / Context
The current
prepareStep()insrc/agent/orchestrator.tsinjects memory entries filtered by category into every agent turn. With strategic docs (design.md at 15K tokens, implementation-plan.md at 15K tokens, guides totaling ~7K tokens), this adds ~37K tokens to every turn's context.Over 180 turns, that's 6.7M tokens of repeated strategic doc content that the agent may only reference occasionally.
Proposed Solution
This was already implemented in commit
2d047b2(feat(agent): replace push-based strategic docs with pull-based tool access). Verify the implementation is working correctly and producing the expected token savings.The approach:
prepareStep()readProjectDoctool that lets the agent fetch specific docs when neededAcceptance Criteria