Skip to content

Commit c621b7a

Browse files
cherry-pick-opsclaude
andcommitted
docs(server-beta): state what the summary input budget does not cover
Greptile flagged that the budget compares event-block bytes while buildServerGenerationPrompt goes on to add the request wrapper, the project/session/job tags, the instructions and the observation schema. Correct: built with zero events, that envelope measures 1,244 bytes here. Left out of the budget rather than reserved from it. Unlike the payload, the envelope is a fixed cost -- it scales with neither event count nor payload size -- so at the 600 KB default it is 0.2%, and the only budgets it could decide are ones already too small to produce a useful summary (~1 KB buys a single truncated tool call). Documented instead of enforced because every additional thing this function knows about the prompt is another thing that can drift out of sync with the builder, which is what produced the bug this PR fixes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 804a718 commit c621b7a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/server/generation/ProviderObservationGenerator.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ export interface ProviderObservationGeneratorOptions {
7373
// close carries the outcome and what was left pending. Dropping the middle
7474
// yields a partial summary, which is strictly better than the current outcome
7575
// for these sessions — an unrecoverable failure and no summary at all.
76+
// Bounds the SESSION INPUT, not the finished prompt: buildServerGenerationPrompt
77+
// wraps the selected event blocks in request/project/job tags, the instructions and
78+
// the observation schema. That envelope is a fixed cost — 1,244 bytes with the mode
79+
// active here, independent of event count and payload size — so it is left out of
80+
// the budget rather than reserved from it. At the default that is 0.2%; only a
81+
// budget small enough to be unusable anyway (~1 KB buys one truncated tool call)
82+
// would be decided by it.
7683
const SUMMARY_INPUT_BUDGET_BYTES = Number.parseInt(
7784
process.env.CLAUDE_MEM_SUMMARY_INPUT_BUDGET_BYTES ?? '',
7885
10,

0 commit comments

Comments
 (0)