انتقل إلى المحتوى
#0706
ExecAgent

The transcript loses the bytes the model already saw

An agent working a codebase re-reads files, and each read rides along in the transcript forever. By turn thirty, the same 400-line module sits in the context five times: and bills five times, every turn.

A script between the agent and the gateway fixes this in transit. Before forwarding, it scans the message history for repeated file blobs and replaces each repeat with a short pointer to its first occurrence. The first copy stays, so the model keeps the content. The four duplicates stay home.

The agent doesn't change, the model doesn't notice, and the prompt shrinks by whatever your agent's re-reading habit was costing: for file-heavy sessions, a fifth to a third of the bill.

The context the model needs survives; the bytes it already saw stay home.