Repository navigation
Conversation
Backport of the credit rate from 84f24f3, without the machine-size work it sits on. A credit is meant to be a minute of a small machine, which the provider bills at 0.5×: 30 billable seconds. The code charged 60. Balances are worked out from raw usage seconds at the current rate, so just changing it would re-price all past usage too. The rate now goes by the UTC day the usage fell on: days before CLOUD_CREDIT_RATE_FROM stay at 60 seconds a credit, and from that day on it's CLOUD_CREDIT_SECONDS. That covers the balance, plan periods, usage per day and a running machine's live estimate, which is split at midnight UTC. Provider seconds and dollars don't change. Without a real day in CLOUD_CREDIT_RATE_FROM every day stays at 60, even with CLOUD_CREDIT_SECONDS set. Production's wrangler block carries the new rate and a placeholder day, so merging changes nothing until a deployer picks one. Staging's block is unchanged and stays at 60. The apps' "about N hours" copy is left as it is: main's apps have no small machine to name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Production was deployed by hand on 2026-11-12 at about 20:00 UTC (Cloudflare version 52798b85) with this day. Never move or remove it once it has come: that would re-price the days in between. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
Contributor
Author
|
Deployed by hand to production on 2026-11-12 ~20:00 UTC: Cloudflare version 52798b85, built from this branch plus CHAT_RELAY_LAYER="1" (#1381) and CLOUD_CREDIT_RATE_FROM=2026-11-13, which is now committed here. After the deploy: install/releases links 200, all 11 secrets and every binding kept, 2,399 ok / 0 errors in 45 s of live traffic. Rollback: |
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.
Backports only the credit rate from 84f24f3 (on
zeron/zgx) tomain, without 6c4d8a0 or the otherzeron/zgxedge commits it sits on.What changes
CLOUD_CREDIT_RATE_FROMstay at 60 billable seconds a credit. From that day on, a credit costsCLOUD_CREDIT_SECONDS.wrangler.jsonc:CLOUD_CREDIT_SECONDS: "30",CLOUD_CREDIT_RATE_FROM: "SET-AT-DEPLOY". Anything that isn't a realYYYY-MM-DDkeeps every day at 60, so merging changes nothing until a deployer sets the day.Conflict resolution
cloud-account.ts: kept main's size lookup. Main has no live resize (s.machine). Only the estimate now goes throughunmeteredCredits.cloud.workerd.test.ts: kept main'spolicyimport (noMACHINES) and added the metering imports.Left out
defaultmachine by 2×.apps/zgxcopy changes. That app ships fromzeron/zgx.Deploying
Set
CLOUD_CREDIT_RATE_FROMto a whole UTC day after the deploy day. Don't move or remove it once that day has come: doing so re-prices the days in between.Tests (edge only)
metering.test.tsdoesn't load because the new exports are missing, 1 test fails incredit-pricing, and 5 workerd tests fail.tsc --noEmitis clean.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.