Repository navigation
Show the hourly budget and spare the cheat sheets - #1
Merged
Merged
Conversation
- Add addresses to host.list/host.get and an IP-to-host recipe, so the model finds whose machine an IP from a DSN is instead of guessing it from metric labels - Note the pitfalls: an empty list proves nothing, network is the interface mask (/32 in clouds), the Nomad bridge still comes through - Extend the hosts fixture and assert DefaultJQ keeps addresses whole
- Take the rate-limit denial as a JSON-RPC error -32010 with the reason, retry_after and the budget in data, instead of a text/plain 429 the bridge showed as "server unavailable" - Take the transport's refusal of a repeated key and of a call without an id, and the RPM fix for slow batches - Assert in the conformance test that the 429 answers the call
- Exempt help, repo_map, resources/read and prompts/get from the hourly budget: they cost nothing and teach the caller to spend less, and a spent budget used to take them away first - Exempt the handshake and the lists too, so a bridge reconnecting with the budget spent can still connect and ask for help - Keep RPM and the concurrency slots on every exempt call - Test the exemptions and a spent budget through the whole endpoint
- Label every charge with the target it went to: api_call per call,
db_query per statement, db_introspect per table, so
app_mcp_ratelimit_charge_seconds{label} says who spent the budget
instead of an evening of summing duration_ms in Loki
- Label only after the catalogue has resolved the target, so a name
the caller made up cannot become a series
- Add budget (used, limit, left, reset_in) to the answers of api_call, db_query and db_introspect, with the call's own charges in it, so a long investigation narrows its queries before it hits the ceiling - Add it to help as well: exempt from the budget, it is the one call that still answers once the budget is spent - Tell the model in the instructions what the field and a -32010 refusal mean, and that help and repo_map keep working - Note in local.toml.dist which calls the budget spares
- Charge code_read per window, code_search per repository and the other code tools per call, so their answers carry the budget with the call's own work in it, and the charge histogram shows which repository spent it - Bill a search across repositories for every one of them, as a batch is billed, rather than for the slowest by the wall clock - Charge the tracker lookup in why under the tracker's own name - Tell the model about the budget only when CostBudgetPerHour is set, as one rule for every paid tool instead of a list - Take the handshake methods and the refusal code from mcpkit - Test that used holds the answer's own work summed, that charges are labelled per window, repository and tracker, and that the spared calls answer without any error - Let the topsrv jq example pass a host without addresses
- Rename the task keys in fixtures from a real tracker project to ABC-, and drop the key of a real incident from a comment - Rename service and function names borrowed from real projects in fixtures and comments to made-up ones
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
-32010and the wait and the budget indata, instead of atext/plain429 a bridge showed as "server unavailable"help,repo_map, resources, prompts, the handshake and the lists the hourly budget, so a spent budget no longer takes away the cheat sheets and the reconnect first; RPM and the concurrency limits still apply to thembudget(used,limit,left,reset_in) to the answers of every tool that spends it and ofhelp, with the call's own work in it, so a long investigation narrows its queries before it hits the ceilingapp_mcp_ratelimit_charge_secondssays who spent the budget; the code tools' charges move off thewall_clocklabelusedholds an answer's own work