Repository navigation
Conversation
…udget `Actor.charge()` used to cap the count it sent at the events that fit the remaining budget plus one, and to skip the API call once the run was over budget. It now sends the full requested count of a priced event on every call. The platform bills events only up to `max_total_charge_usd` and aborts the run once its own counts reach it, so it decides what is billed. The returned `ChargeResult` is unchanged: `charged_count` and `event_charge_limit_reached` are still computed from the remaining budget, and the locally tracked counts still register `charged_count`. Synthetic, unknown, and tier-priced events, local runs, and multi-tenant runs behave as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAJqma86JbvfSpTQCwX
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAJqma86JbvfSpTQCwX
`charged_count` no longer includes the extra event over the budget, since every charge now reaches the platform in full. The locally tracked counts take the full count, matching what the platform records. A push without an explicit event reports only the items within the budget as charged, like a push with one. `push_data` still lets one item through when the budget can't cover any, so that the platform detects the exhausted budget. The charge-limit e2e test waits until the platform accounts the charges and checks that only the events within the budget are billed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAJqma86JbvfSpTQCwX
The platform doesn't bill an Actor's owner for its own runs, and the e2e tests run the Actor with the account that owns it, so the accounted counts stay at 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAJqma86JbvfSpTQCwX
Pijukatel
marked this pull request as ready for review
December 4, 2026 14:23
This branch has not been deployed
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.
Actor.charge()now sends the full requested count of a priced event to the platform on every call, including when the run is already over budget. The platform bills only up tomax_total_charge_usdand aborts the run, so it alone decides what is billed.ChargeResult.charged_countreports only the events within the budget, without the former extra event. Synthetic events, local runs, multi-tenant runs, and thepush_datalimits are unchanged.