What Codex Actually Sends to the Model
0xkato 2 months ago 20
A developer recorded the HTTP requests Codex sends to models and measured their size across different scenarios, finding that a 16-character prompt resulted in a 42,980-byte request with 9,435 tokens, 99.7% from system instructions and tool definitions rather than the user input. File reads, command output, images, and project instructions all get accumulated in requests, with large files triggering head-and-tail truncation once context exceeds thresholds. When history grows too large, Codex compacts it by sending accumulated context through a separate model request, replacing the detailed history with a generated summary before resuming the conversation.