You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PromptTemplateEscaper.fence() mints a fresh 32-hex-char CSPRNG token per call. A random hex string does not tokenize to a fixed BPE width — measured over 2000 draws: min 53, max 81 tokens, spread 28.
Both AbstractPrSuggestionGenerator.sharedPromptOverhead (shared by /describe, /improve, /add-docs, /generate-tests) and DiffBudgetPlanner.plan(...) size their overhead by drawing a live fence. So the overhead subtracted from the budget varies by up to ~30 tokens between runs of the same input, and the resulting batch plan is not reproducible.
This is not a production bug. The sample is an unbiased estimate of an overhead that genuinely is random per call, and a ~30-token error is absorbed by token-safety-margin at real budgets of 10⁵. It is recorded because:
Non-reproducible planning is awkward to reason about generally — the same PR can batch differently on two runs with no input change.
Suggested direction: size the overhead from a fixed-width representative fence (the width is what matters, not the value; the real fence still gets used in the emitted prompt). Plans then become reproducible for a given input, and the class of rare test flake disappears rather than being padded around.
Found while diagnosing #586.
PromptTemplateEscaper.fence()mints a fresh 32-hex-char CSPRNG token per call. A random hex string does not tokenize to a fixed BPE width — measured over 2000 draws: min 53, max 81 tokens, spread 28.Both
AbstractPrSuggestionGenerator.sharedPromptOverhead(shared by/describe,/improve,/add-docs,/generate-tests) andDiffBudgetPlanner.plan(...)size their overhead by drawing a live fence. So the overhead subtracted from the budget varies by up to ~30 tokens between runs of the same input, and the resulting batch plan is not reproducible.This is not a production bug. The sample is an unbiased estimate of an overhead that genuinely is random per call, and a ~30-token error is absorbed by
token-safety-marginat real budgets of 10⁵. It is recorded because:max-input-tokenscarry the same latent fragility, and will fail the same way, rarely, for the same reason. Disclosure classification races under the parallel batch pass (flaky test, possible real bug) #586's fix pads its own fixtures past the jitter but does not address the others.Suggested direction: size the overhead from a fixed-width representative fence (the width is what matters, not the value; the real fence still gets used in the emitted prompt). Plans then become reproducible for a given input, and the class of rare test flake disappears rather than being padded around.