Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python
1.4 KB
Raw Blame

v0.302.60

Compaction state survives a restart.

  • Resumed sessions keep their real context size. After a Responses provider counts a session's compaction state, that count is saved with the session and reapplied when it is loaded, for the same state, provider and model. A restart used to re-estimate the opaque state from its byte size: in a controlled test an 8 MB state counted at about 80k tokens restored as about 508k, so the meter showed 188% and the next prompt paid for a forced compaction. It now restores at the counted size (#1686, ADR 0307).
  • WebSocket sessions are counted during normal use. The count is learned from chained replies (previous_response_id) as well as full requests; OpenAI bills the whole chain as input, which is how the meter already reads it. chatgpt-new uses WebSocket by default.
  • Large compaction items work over WebSocket. The WebSocket client accepts events up to 128 MiB, matching SSE. A larger item used to fail, retry on a fresh socket, and fall back to SSE, re-running the turn each time.
  • chatgpt-new can be tested offline. GRAFF_CHATGPT_URL points its Responses endpoint, WebSocket and model discovery at a local mock, as GRAFF_CODEX_URL does for codex.

Sessions saved before this release carry no count, so their first reload still estimates the state until the next reply.

Includes all changes from v0.302.59.