04336308f58599471f35d527b8d2b8e47ab3b064
The stage completion cap (e.g. 24_576) is a ceiling, not a promise. When the rendered prompt + tool schemas fill most of the model window, sending the raw cap makes llama.cpp truncate the prompt from the left — the traced Gemma4 32_767-token blow-up. Compute effectiveMaxTokens = min(cap, contextSize - promptTokens - toolSchemas - templateOverhead - reserve), counting prompt/tool tokens with the model's own tokenizer (char/4 fallback). Live-path only; deterministic replay never calls infer, so no event recording needed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
fix: workflow inference chain — surface llama-server errors, user-turn-last, bundle-relative prompts
Description
No description provided
Languages
Kotlin
88.4%
Go
11.4%
Python
0.2%