Files
reverse-engineering-anything/docs/reference
morluto 6b57e8e17d fix(delivery): refuse within the budget when even the summary is over it (#15591)
* fix(delivery): refuse within the budget when even the summary is over it

When complete Evidence was over the agent result budget, MCP retained it
and delivered its summary without measuring the summary. A deb package
with many ar members, for example, produced a summary larger than the
budget it was meant to fit.

Measure the summary before retaining it. When it is still over the
budget, return a resource_constraint error that carries the same
delivery facts in details.reported_limits.agent_budget: the complete
size, the budget, the retained complete Evidence ID and the
inspect_analysis_view call that pages it within the budget. Errors are
already delivered within the budget.

The CLI path, which builds its summary separately, is unchanged.

* fix(delivery): measure the delivered answer and describe the refusal

- Measure the {summary, delivery} answer MCP sends, not the summary
  alone, when deciding whether the summary fits the budget.
- The refusal's delivery note says neither the result nor its summary
  was delivered, instead of reusing the summary-delivered note.
- Offer repeating the call with detail complete only for idempotent
  tools; a call with effects is told not to repeat its completed call.
- Build all three delivery refusals in this file through one
  responseRefusal helper, and lower the resource-constraint constructor
  baseline it no longer needs.

* Merge origin/main into fix/over-budget-summary-refusal

Also lower the untyped-budget-refusal baseline for ToolResultDelivery.ts,
which now builds its refusals through one helper.

* Merge origin/main into fix/over-budget-summary-refusal

With #15638, the page delivery.next names fits the effective budget.
The deb regression now asserts the followed page is within 4,096 bytes,
and the minimum-budget paging test accepts the refusal this branch
returns when the summary answer is over the budget too, following the
same next call.

* test(firmware): select a budget the vector-table summary answer fits

The test selected the 4,096-byte minimum budget to make the complete
vector-table report over budget. At that budget the summary answer with
its delivery facts is over the budget too, so this branch now refuses
with paging facts instead. Select 12,000 bytes: above the summary
answer and below the about 18 KB complete report, so the test still
exercises summary delivery.
2026-12-01 18:46:37 -05:00
..