Repository navigation
feat(client): a call limit takes a cost for each call (CLI-122) - #496
Merged
Merged
Conversation
… refusal is a 413 (CLI-122) WIP: this code is written against @mark1russell7/service 0.7.0 (systems#408: take(key, units), the union Refused). The dependency stays ^0.6.0 until 0.7.0 is on npm, thus this commit does not compile yet. The next commit raises it to ^0.7.0. - CallLimit.cost: a whole number of 1 or more, or a function of the call (default 1). admit() takes that many units of each limit. - A capacity refusal is PAYLOAD_TOO_LARGE, not retryable, with the metadata reason "capacity", units and capacity. HTTP answers 413 with both numbers in the body and no Retry-After. The HTTP client, the HTTP batch and the MCP face carry both numbers. WebSocket carries the metadata as it is. - ContractSpec.limits: the transport contract checks the capacity refusal on each server face. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…al only (service 0.7.0) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to the policy (CLI-122) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # packages/client-mongo/package.json # packages/client/package.json # pnpm-lock.yaml
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
A call limit takes a cost for each call (roadmap CLI-122). With merged pushes, one batch of 100 items cost one unit, the same as one call.
CallLimitgets the fieldcost: a whole number of 1 or more, or a function of the call. The default is 1.costunits in one atomic step withtake(key, units)of@mark1russell7/service0.7.0.PAYLOAD_TOO_LARGE, not retryable. The metadata hasreason: "capacity",unitsandcapacity.unitsandcapacityin the body and noRetry-After. The HTTP client, the batch, the WebSocket and the MCP faces carry both numbers.@mark1russell7/service^0.7.0, so the lockfile holds one version of it.Version
MINOR of the client group (D13, a break before 1.0). In service 0.7.0,
Refusedis a union, and only a wait refusal hasretryAfter.limiters()gives the keyed limiters of the service, so code that readsretryAfterof their decisions does not compile. The changeset gives the migration steps.Merge order
This break merges alone, after the release of #489 (0.53.0). It stays a draft until then.
🤖 Generated with Claude Code