feat(budget): a tool may name its own result bound, defaulting to the ceiling #725

Merged
coilyco-ops merged 1 commit from coilyco-ops/per-tool-result-bound into main 2026-08-13 20:56:29 +00:00 AGit
Member

closes #635 engineer half - per-tool bound; sizing stays on #362. Behaviour-neutral until a tool is named.

closes #635 engineer half - per-tool bound; sizing stays on #362. Behaviour-neutral until a tool is named.
feat(budget): a tool may name its own result bound, defaulting to the ceiling
All checks were successful
ci / image-build (pull_request) Successful in 23s
ci / test (pull_request) Successful in 37s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped
a8bfb3f2e3
sirens-echo#635 measured 87% of a member's Steam library discarded into a
16 KiB cap, and its sharpest line was not about the number:

  The flat ceiling across tools is more suspect than its value.

One bound covered all 52 tools, so a cap that suits list_channel-message
governed get_owned_games too, and no value could suit both.

ModelBudget gains tool_result_bytes_by_tool, keyed by the model-facing
tool name. An absent key inherits tool_result_bytes, so every deployed
definition resolves to exactly the byte count it resolves to now. No tool
is given an override here.

Zero is refused rather than read as unset. An absent key already means
inherit, so a present zero would mean deliver nothing, which is never
what anyone configuring a ceiling meant.

The span's mcp.tool.limit_bytes now reports the bound that actually
applied rather than the budget-wide one, so #635's third acceptance line
keeps holding once bounds differ per tool.

The map makes ModelBudget non-comparable, so one existing test moves to
reflect.DeepEqual. Its assertion is unchanged.

This is the mechanism only. The sizing decision stays on #362, which is
Kai's, and deriving context limits from the model window is untouched.

Refs sirens-echo#635, sirens-echo#362

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-gaming/sirens-echo!725
No description provided.