#959·openwiki

Bound the per-turn input transcript on code --update

Author: gsarapuraCreated Sep 30, 2026Updated Sep 30, 2026

code --update resends the system prompt, the wiki brief, and every source file that page’s agent has already read on every model turn. There is no input budget. OPENWIKI_MAX_OUTPUT_TOKENS only caps the answer, and in practice the answer is a few hundred tokens.

We measured a nightly incremental run of 13 repositories on Bedrock Claude Haiku 4.5 (us.anthropic.claude-haiku-4-5-20251001-v1:0), OpenWiki 0.6.0, after injecting cache_control outside OpenWiki (LiteLLM) because the Bedrock path still does not set it (#853):

  • 675 calls, about 21.0M prompt tokens
  • Per call: ~28,300 cache-read, ~2,800 cache-write, ~6 fresh input, ~440 output
  • The transcript is still ~31k tokens. Caching only changes how the repeat is billed inside one run. Prefill of that prefix is what makes each call slow. The cache expires within minutes, so the next run starts cold.

--update already skips a repo whose source fingerprint is unchanged. Any new commit still runs the full agent, including runs that then rewrite only .last-update.json.

This is not the --init token explosion (#934), a single request over the context window (#648), or the oversized openwiki_begin tool result (#919).

Ask: trim or summarize tool results already in the transcript, or add a per-turn input budget, so later turns do not resend full file bodies. Prompt caching (#853, #696) should stay; it does not shrink the prompt the model has to read.