QueryEngine 46K-Line File

Description

The src/QueryEngine.ts file described by the rebuild prompts as approximately 46,000 lines and 'the most complex single file' in the leaked codebase. It is the central orchestration class that sends messages to the Anthropic API (streaming), processes streaming response blocks (text, thinking, tool_use), runs the tool loop, handles retries and rate limits, tracks token usage/costs, and manages conversation context history.

Key claims

Relations

Sources

src-20260420-8f8287660d1e