René's URL Explorer Experiment


Title: fix(billing): hold free plans to their allowance mid-run by waleedlatif1 · Pull Request #9462 · simstudioai/sim · GitHub

Open Graph Title: fix(billing): hold free plans to their allowance mid-run by waleedlatif1 · Pull Request #9462 · simstudioai/sim

X Title: fix(billing): hold free plans to their allowance mid-run by waleedlatif1 · Pull Request #9462 · simstudioai/sim

Description: Summary Free-plan spend past the one-time allowance is never billed, but runs could overshoot it: the verdict returned after each Mothership cost callback came from a cached admission (free payers are always "near limit", so up to a 10 s window), and an unreadable or slow standing read answered not-exceeded After a cost callback, a free payer's standing is now read fresh from the ledger (checkAttributedUsageLimits, the function the cache wraps; the direct-v1 path skips its verdict cache and shared in-flight read), so the callback that crosses the limit pauses the run Free payers fail closed when standing can't be read — update-cost (unknown or the 1 s budget), the provider mid-run check, the copilot continuation re-check, and Mothership continuation admission all stop/refuse a free run with the usage card. Paid plans and orgs keep today's fail-open behaviour so a database blip never ends a paying run isFreeRunPayer decides free from what the run was admitted with (attributed payerSubscription; a direct-v1 decision without payerSubscriptionId), so no new query; errors land on the paid (status-quo) side Default free-plan concurrency 10 → 2 (docs table updated); admission caching for workflow executions is unchanged Type of Change Bug fix Testing app/api/billing/update-cost/route.integration.ts (real Postgres): free direct-v1 and free attributed payers are paused when a second callback crosses the limit inside the cache window; a pro payer in the same scenario keeps the cached answer. Red with the fresh-read bypass disabled, green restored Unit: update-cost/route.test.ts (fresh read, unreadable ledger, failed gate read, timeout → exceeded for free; blocked → not exceeded; paid unchanged), providers/run-usage-limit.test.ts, copilot/api-keys/validate/route.test.ts, mothership/request/lifecycle/admission.test.ts — each new free-payer guard shown red with the guard reverted lib/billing + touched route/provider/lifecycle suites green; biome, check:test-patterns, check:comment-hygiene, check:unused-exports, check:file-names, check:boundaries Full type-check / audits / suites left to CI Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing (new tests pass the test-audit authoring gate) No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary Free-plan spend past the one-time allowance is never billed, but runs could overshoot it: the verdict returned after each Mothership cost callback came from a cached admission (free payers...

X Description: Summary Free-plan spend past the one-time allowance is never billed, but runs could overshoot it: the verdict returned after each Mothership cost callback came from a cached admission (free payers...

Opengraph URL: https://github.com/simstudioai/sim/pull/9462

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:55d439a9-003a-b2f9-2939-ca932ec2d01b
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBDCA:2AA174:1E9988:2D7D66:6AFB1F11
html-safe-noncec0b48bde4b36941f575b717257625b49157e830720d0b5328e4ad7e976bf9aec
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRENBOjJBQTE3NDoxRTk5ODg6MkQ3RDY2OjZBRkIxRjExIiwidmlzaXRvcl9pZCI6IjI3MjY1OTc1NDUxMzA5MjU4NDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacbb8b3febcaab87d80a3598714415a42ce53cb55a3e6ce807d0fc11aef47f3808
hovercard-subject-tagpull_request:5077904540
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/9462/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary Free-plan spend past the one-time allowance is never billed, but runs could overshoot it: the verdict returned after each Mothership cost callback came from a cached admission (free payers...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonef9219899e0d0ce0b87aeba2c640c955f83631457e5baff5df7a36ce599d2635b
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasedd3b60f1fd9c5f10a3dcde41ae35682f53e85cee
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/9462/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F9462%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F9462%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/9462/files
Reloadhttps://github.com/simstudioai/sim/pull/9462/files
Reloadhttps://github.com/simstudioai/sim/pull/9462/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests198 (198)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
fix/free-tier-cap-integrityhttps://github.com/simstudioai/sim/tree/fix/free-tier-cap-integrity
Conversation 22 https://github.com/simstudioai/sim/pull/9462
Commits 3 https://github.com/simstudioai/sim/pull/9462/commits
Checks 68 https://github.com/simstudioai/sim/pull/9462/checks
Files changed https://github.com/simstudioai/sim/pull/9462/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9462/files
fix(billing): hold free plans to their allowance mid-run https://github.com/simstudioai/sim/pull/9462/files#top
Show all changes 3 commits https://github.com/simstudioai/sim/pull/9462/files
4e74dc0 fix(billing): hold free plans to their allowance mid-run waleedlatif1 Oct 30, 2026 https://github.com/simstudioai/sim/pull/9462/commits/4e74dc0c2a4dbac1e8e80a48dcf796b76a8e3034
4d55764 fix(billing): read free payers fresh in the provider check and judge … waleedlatif1 Oct 30, 2026 https://github.com/simstudioai/sim/pull/9462/commits/4d55764ccab179a233244e685f2497b4304e4ead
76cad8a fix(billing): bound free payers' fresh usage reads and shrink the tes… waleedlatif1 Oct 30, 2026 https://github.com/simstudioai/sim/pull/9462/commits/76cad8aa9b0a5dee022b6ace01f3274de74305e4
Clear filters https://github.com/simstudioai/sim/pull/9462/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9462/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9462/files
costs.mdx https://github.com/simstudioai/sim/pull/9462/files#diff-12cc8dfa1b82a7ec2592d132fd57bbbea88739eba270283df9947adf899e850f
route.integration.ts https://github.com/simstudioai/sim/pull/9462/files#diff-4f0c196bfeb7b8fe42baaf013f4a8327fb66616fefc383aef30803f913b5d898
route.test.ts https://github.com/simstudioai/sim/pull/9462/files#diff-677bfcaef15030c7faf8ec352470f5316a835307b7e997ca1fac1a9e357b1d59
route.ts https://github.com/simstudioai/sim/pull/9462/files#diff-f3ec9e3eecbe194c2377f2e873f10be432af241ae9be88b693e9fec6699f335b
route.test.ts https://github.com/simstudioai/sim/pull/9462/files#diff-5f87cf2acbc6646b935f3ead5fee036c12372aac4eb69c4bd164cf27f6d9d7a4
route.ts https://github.com/simstudioai/sim/pull/9462/files#diff-11279d916ce2d7a7a6c2ab9d16a47e66ac95888511d8dbd22152011c075cabf9
concurrency-defaults.ts https://github.com/simstudioai/sim/pull/9462/files#diff-3d151fb79c1268098ea1b7c5ce6e29cf333c7f350edf7f157e68c5e4b18c957b
mid-run-usage.ts https://github.com/simstudioai/sim/pull/9462/files#diff-875018a4710b7addc2df798782b921db6296a69c53c395dd3bdd3ad755189a66
sim.ts https://github.com/simstudioai/sim/pull/9462/files#diff-2780f91265529f8f08e07c54a900106ef2350b9bf686eddfb276ade6d584be6f
admission.test.ts https://github.com/simstudioai/sim/pull/9462/files#diff-6effbe1ce7045fce0289ec038b5fe4608968020467569e222d59b165dd32faa7
admission.ts https://github.com/simstudioai/sim/pull/9462/files#diff-ccec8d8e4d5b0de2d03166fc6016db019489df46e42845b6a17d99dd88a738a1
run-usage-limit.test.ts https://github.com/simstudioai/sim/pull/9462/files#diff-0a1e3455be6ef2ec34b29f232dbc6ed27c9ba023a2d036f314f4fe62998cad2b
run-usage-limit.ts https://github.com/simstudioai/sim/pull/9462/files#diff-94ed7a34417469683e40c65186aa5c787d9380ba8f0723cc83746276a5431645
check-test-types.baseline.json https://github.com/simstudioai/sim/pull/9462/files#diff-3f0e52298332b82e821be5c9210ddb89bb43ab248c2db79c27e6a783dbfe9e36
apps/docs/content/docs/platform/costs.mdxhttps://github.com/simstudioai/sim/pull/9462/files#diff-12cc8dfa1b82a7ec2592d132fd57bbbea88739eba270283df9947adf899e850f
View file https://github.com/simstudioai/sim/blob/76cad8aa9b0a5dee022b6ace01f3274de74305e4/apps/docs/content/docs/platform/costs.mdx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9462/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/9462/files#diff-12cc8dfa1b82a7ec2592d132fd57bbbea88739eba270283df9947adf899e850f
https://github.com/simstudioai/sim/pull/9462/files#diff-12cc8dfa1b82a7ec2592d132fd57bbbea88739eba270283df9947adf899e850f
apps/sim/app/api/billing/update-cost/route.integration.tshttps://github.com/simstudioai/sim/pull/9462/files#diff-4f0c196bfeb7b8fe42baaf013f4a8327fb66616fefc383aef30803f913b5d898
View file https://github.com/simstudioai/sim/blob/76cad8aa9b0a5dee022b6ace01f3274de74305e4/apps/sim/app/api/billing/update-cost/route.integration.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9462/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/9462/files#diff-4f0c196bfeb7b8fe42baaf013f4a8327fb66616fefc383aef30803f913b5d898
https://github.com/simstudioai/sim/pull/9462/files#diff-4f0c196bfeb7b8fe42baaf013f4a8327fb66616fefc383aef30803f913b5d898
https://github.com/simstudioai/sim/pull/9462/files#diff-4f0c196bfeb7b8fe42baaf013f4a8327fb66616fefc383aef30803f913b5d898
https://github.com/simstudioai/sim/pull/9462/files#diff-4f0c196bfeb7b8fe42baaf013f4a8327fb66616fefc383aef30803f913b5d898
https://github.com/simstudioai/sim/pull/9462/files#diff-4f0c196bfeb7b8fe42baaf013f4a8327fb66616fefc383aef30803f913b5d898
https://github.com/simstudioai/sim/pull/9462/files#diff-4f0c196bfeb7b8fe42baaf013f4a8327fb66616fefc383aef30803f913b5d898
https://github.com/simstudioai/sim/pull/9462/files#diff-4f0c196bfeb7b8fe42baaf013f4a8327fb66616fefc383aef30803f913b5d898
https://github.com/simstudioai/sim/pull/9462/files#diff-4f0c196bfeb7b8fe42baaf013f4a8327fb66616fefc383aef30803f913b5d898
https://github.com/simstudioai/sim/pull/9462/files#diff-4f0c196bfeb7b8fe42baaf013f4a8327fb66616fefc383aef30803f913b5d898
apps/sim/app/api/billing/update-cost/route.test.tshttps://github.com/simstudioai/sim/pull/9462/files#diff-677bfcaef15030c7faf8ec352470f5316a835307b7e997ca1fac1a9e357b1d59
View file https://github.com/simstudioai/sim/blob/76cad8aa9b0a5dee022b6ace01f3274de74305e4/apps/sim/app/api/billing/update-cost/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9462/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/9462/files#diff-677bfcaef15030c7faf8ec352470f5316a835307b7e997ca1fac1a9e357b1d59
https://github.com/simstudioai/sim/pull/9462/files#diff-677bfcaef15030c7faf8ec352470f5316a835307b7e997ca1fac1a9e357b1d59
https://github.com/simstudioai/sim/pull/9462/files#diff-677bfcaef15030c7faf8ec352470f5316a835307b7e997ca1fac1a9e357b1d59
https://github.com/simstudioai/sim/pull/9462/files#diff-677bfcaef15030c7faf8ec352470f5316a835307b7e997ca1fac1a9e357b1d59
https://github.com/simstudioai/sim/pull/9462/files#diff-677bfcaef15030c7faf8ec352470f5316a835307b7e997ca1fac1a9e357b1d59
https://github.com/simstudioai/sim/pull/9462/files#diff-677bfcaef15030c7faf8ec352470f5316a835307b7e997ca1fac1a9e357b1d59
https://github.com/simstudioai/sim/pull/9462/files#diff-677bfcaef15030c7faf8ec352470f5316a835307b7e997ca1fac1a9e357b1d59
https://github.com/simstudioai/sim/pull/9462/files#diff-677bfcaef15030c7faf8ec352470f5316a835307b7e997ca1fac1a9e357b1d59
https://github.com/simstudioai/sim/pull/9462/files#diff-677bfcaef15030c7faf8ec352470f5316a835307b7e997ca1fac1a9e357b1d59
https://github.com/simstudioai/sim/pull/9462/files#diff-677bfcaef15030c7faf8ec352470f5316a835307b7e997ca1fac1a9e357b1d59
https://github.com/simstudioai/sim/pull/9462/files#diff-677bfcaef15030c7faf8ec352470f5316a835307b7e997ca1fac1a9e357b1d59
https://github.com/simstudioai/sim/pull/9462/files#diff-677bfcaef15030c7faf8ec352470f5316a835307b7e997ca1fac1a9e357b1d59
https://github.com/simstudioai/sim/pull/9462/files#diff-677bfcaef15030c7faf8ec352470f5316a835307b7e997ca1fac1a9e357b1d59
Please reload this pagehttps://github.com/simstudioai/sim/pull/9462/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9462/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.