René's URL Explorer Experiment


Title: fix(tools): check usage limits before running hosted-key tools via the API by waleedlatif1 · Pull Request #8602 · simstudioai/sim · GitHub

Open Graph Title: fix(tools): check usage limits before running hosted-key tools via the API by waleedlatif1 · Pull Request #8602 · simstudioai/sim

X Title: fix(tools): check usage limits before running hosted-key tools via the API by waleedlatif1 · Pull Request #8602 · simstudioai/sim

Description: Summary Check the workspace's usage limits before running a tool that would use a Sim-hosted key via POST /api/v2/tools/{toolId}/execute, using the same cached execution gate as workflow runs Return 402 USAGE_LIMIT_EXCEEDED when the limit is exceeded, and document it in the OpenAPI spec Type of Change Bug fix Testing execute-tool.test.ts and the route test (new cases fail with the fix reverted) bun run lint, bun run type-check, bun run check:audits, docs-manifest:check, block-registry check test:scripts: generate-docs.test.ts times out locally, same on clean staging 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) 🤖 Generated with Claude Code

Open Graph Description: Summary Check the workspace's usage limits before running a tool that would use a Sim-hosted key via POST /api/v2/tools/{toolId}/execute, using the same cached execution gate as workflow runs ...

X Description: Summary Check the workspace's usage limits before running a tool that would use a Sim-hosted key via POST /api/v2/tools/{toolId}/execute, using the same cached execution gate as workflow r...

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

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:5313811c-ac3b-1d4a-58af-33af94aa567a
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC2E6:160F17:AEFBE7:F61360:6AFB79A4
html-safe-nonce6365f649600750ee314eaefd03dafb9d92032dab89a07cd08893a3f70b642772
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMkU2OjE2MEYxNzpBRUZCRTc6RjYxMzYwOjZBRkI3OUE0IiwidmlzaXRvcl9pZCI6Ijg2MjAzMTIzMDA0NzkwMTk0MjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd84bb637c7b46e351d2652357a9159507b3823cbe57e889b6d1f07ceacd6e3b7
hovercard-subject-tagpull_request:4729074634
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/8602/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 Check the workspace's usage limits before running a tool that would use a Sim-hosted key via POST /api/v2/tools/{toolId}/execute, using the same cached execution gate as workflow runs ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0e29e7974fdda2feeaf5c891efd4b23b0734b23480232b62c7bdef13f40b5b48
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
release2e8872b770cc4d5d0cc1f2026afab747a268e2ce
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/8602/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F8602%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%2F8602%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/8602/files
Reloadhttps://github.com/simstudioai/sim/pull/8602/files
Reloadhttps://github.com/simstudioai/sim/pull/8602/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests202 (202)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/tool-execute-usage-gatehttps://github.com/simstudioai/sim/tree/fix/tool-execute-usage-gate
Conversation 30 https://github.com/simstudioai/sim/pull/8602
Commits 5 https://github.com/simstudioai/sim/pull/8602/commits
Checks 32 https://github.com/simstudioai/sim/pull/8602/checks
Files changed https://github.com/simstudioai/sim/pull/8602/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8602/files
fix(tools): check usage limits before running hosted-key tools via the API https://github.com/simstudioai/sim/pull/8602/files#top
Show all changes 5 commits https://github.com/simstudioai/sim/pull/8602/files
1c9a6b1 fix(tools): check usage limits before running hosted-key tools via th… waleedlatif1 Oct 3, 2026 https://github.com/simstudioai/sim/pull/8602/commits/1c9a6b131ea831f05b8ba6fa3648b10ad38e816f
45c027c fix(tools): gate hosted-key calls whose key is an unresolved variable… waleedlatif1 Oct 3, 2026 https://github.com/simstudioai/sim/pull/8602/commits/45c027c511a15f7e38b5c9ab827bd9304c902166
b8aff28 fix(tools): exempt variable references that resolve to the caller's o… waleedlatif1 Oct 3, 2026 https://github.com/simstudioai/sim/pull/8602/commits/b8aff280043ecdf09fef3879889a3ec945a2dadd
57bf024 fix(tools): resolve the key reference with the registry's own resolver waleedlatif1 Oct 3, 2026 https://github.com/simstudioai/sim/pull/8602/commits/57bf0246b66ba7773fbf3df3f8dda53c9336df53
e9567b6 fix(tools): decide hosted-key admission on registry-resolved params waleedlatif1 Oct 3, 2026 https://github.com/simstudioai/sim/pull/8602/commits/e9567b63308d2120a0245245c5100d0380e4e110
Clear filters https://github.com/simstudioai/sim/pull/8602/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8602/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8602/files
openapi-v2-resources.json https://github.com/simstudioai/sim/pull/8602/files#diff-17e168777a3b67e689dd8b24e28aaa217cb884843dccad31b1dbf22d5307e17f
route.test.ts https://github.com/simstudioai/sim/pull/8602/files#diff-a14ac214d501d1e0642d68b1b129da23e9c471e0cbb6dd9ee6853b6ca71c70bf
route.ts https://github.com/simstudioai/sim/pull/8602/files#diff-2a3beeada26d54c42361eac7e14692e4d2e3d3923408918899118df00081efd8
resources.ts https://github.com/simstudioai/sim/pull/8602/files#diff-950bda0ee70aa65034c8e1d522aa2ba2d0f18a6097c65d27b9796b1583c8205c
v2-operations.ts https://github.com/simstudioai/sim/pull/8602/files#diff-a32a173b553c777ebd3d9ecabb9cbc5fe7705ac6fa3761dbceaeb5458fc449b7
execute-tool.test.ts https://github.com/simstudioai/sim/pull/8602/files#diff-06a9f9e027535ab13c1ea18cd3bada61efd793c5c5f96024b96160021da314fd
execute-tool.ts https://github.com/simstudioai/sim/pull/8602/files#diff-941ac7a3d6a065c6c8890fe4172ddf1898c5c1eaad611ed5a656049f14fe4a7b
apps/docs/openapi-v2-resources.jsonhttps://github.com/simstudioai/sim/pull/8602/files#diff-17e168777a3b67e689dd8b24e28aaa217cb884843dccad31b1dbf22d5307e17f
View file https://github.com/simstudioai/sim/blob/e9567b63308d2120a0245245c5100d0380e4e110/apps/docs/openapi-v2-resources.json
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8602/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8602/files#diff-17e168777a3b67e689dd8b24e28aaa217cb884843dccad31b1dbf22d5307e17f
https://github.com/simstudioai/sim/pull/8602/files#diff-17e168777a3b67e689dd8b24e28aaa217cb884843dccad31b1dbf22d5307e17f
https://github.com/simstudioai/sim/pull/8602/files#diff-17e168777a3b67e689dd8b24e28aaa217cb884843dccad31b1dbf22d5307e17f
https://github.com/simstudioai/sim/pull/8602/files#diff-17e168777a3b67e689dd8b24e28aaa217cb884843dccad31b1dbf22d5307e17f
https://github.com/simstudioai/sim/pull/8602/files#diff-17e168777a3b67e689dd8b24e28aaa217cb884843dccad31b1dbf22d5307e17f
https://github.com/simstudioai/sim/pull/8602/files#diff-17e168777a3b67e689dd8b24e28aaa217cb884843dccad31b1dbf22d5307e17f
apps/sim/app/api/v2/tools/[toolId]/execute/route.test.tshttps://github.com/simstudioai/sim/pull/8602/files#diff-a14ac214d501d1e0642d68b1b129da23e9c471e0cbb6dd9ee6853b6ca71c70bf
View file https://github.com/simstudioai/sim/blob/e9567b63308d2120a0245245c5100d0380e4e110/apps/sim/app/api/v2/tools/%5BtoolId%5D/execute/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8602/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8602/files#diff-a14ac214d501d1e0642d68b1b129da23e9c471e0cbb6dd9ee6853b6ca71c70bf
https://github.com/simstudioai/sim/pull/8602/files#diff-a14ac214d501d1e0642d68b1b129da23e9c471e0cbb6dd9ee6853b6ca71c70bf
https://github.com/simstudioai/sim/pull/8602/files#diff-a14ac214d501d1e0642d68b1b129da23e9c471e0cbb6dd9ee6853b6ca71c70bf
https://github.com/simstudioai/sim/pull/8602/files#diff-a14ac214d501d1e0642d68b1b129da23e9c471e0cbb6dd9ee6853b6ca71c70bf
apps/sim/app/api/v2/tools/[toolId]/execute/route.tshttps://github.com/simstudioai/sim/pull/8602/files#diff-2a3beeada26d54c42361eac7e14692e4d2e3d3923408918899118df00081efd8
View file https://github.com/simstudioai/sim/blob/e9567b63308d2120a0245245c5100d0380e4e110/apps/sim/app/api/v2/tools/%5BtoolId%5D/execute/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8602/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8602/files#diff-2a3beeada26d54c42361eac7e14692e4d2e3d3923408918899118df00081efd8
https://github.com/simstudioai/sim/pull/8602/files#diff-2a3beeada26d54c42361eac7e14692e4d2e3d3923408918899118df00081efd8
apps/sim/lib/api/contracts/v2/openapi/resources.tshttps://github.com/simstudioai/sim/pull/8602/files#diff-950bda0ee70aa65034c8e1d522aa2ba2d0f18a6097c65d27b9796b1583c8205c
View file https://github.com/simstudioai/sim/blob/e9567b63308d2120a0245245c5100d0380e4e110/apps/sim/lib/api/contracts/v2/openapi/resources.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8602/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8602/files#diff-950bda0ee70aa65034c8e1d522aa2ba2d0f18a6097c65d27b9796b1583c8205c
https://github.com/simstudioai/sim/pull/8602/files#diff-950bda0ee70aa65034c8e1d522aa2ba2d0f18a6097c65d27b9796b1583c8205c
apps/sim/lib/api/mcp/generated/v2-operations.tshttps://github.com/simstudioai/sim/pull/8602/files#diff-a32a173b553c777ebd3d9ecabb9cbc5fe7705ac6fa3761dbceaeb5458fc449b7
View file https://github.com/simstudioai/sim/blob/e9567b63308d2120a0245245c5100d0380e4e110/apps/sim/lib/api/mcp/generated/v2-operations.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8602/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8602/files#diff-a32a173b553c777ebd3d9ecabb9cbc5fe7705ac6fa3761dbceaeb5458fc449b7
https://github.com/simstudioai/sim/pull/8602/files#diff-a32a173b553c777ebd3d9ecabb9cbc5fe7705ac6fa3761dbceaeb5458fc449b7
apps/sim/lib/tool-execution/application/execute-tool.test.tshttps://github.com/simstudioai/sim/pull/8602/files#diff-06a9f9e027535ab13c1ea18cd3bada61efd793c5c5f96024b96160021da314fd
View file https://github.com/simstudioai/sim/blob/e9567b63308d2120a0245245c5100d0380e4e110/apps/sim/lib/tool-execution/application/execute-tool.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8602/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8602/files#diff-06a9f9e027535ab13c1ea18cd3bada61efd793c5c5f96024b96160021da314fd
https://github.com/simstudioai/sim/pull/8602/files#diff-06a9f9e027535ab13c1ea18cd3bada61efd793c5c5f96024b96160021da314fd
https://github.com/simstudioai/sim/pull/8602/files#diff-06a9f9e027535ab13c1ea18cd3bada61efd793c5c5f96024b96160021da314fd
https://github.com/simstudioai/sim/pull/8602/files#diff-06a9f9e027535ab13c1ea18cd3bada61efd793c5c5f96024b96160021da314fd
https://github.com/simstudioai/sim/pull/8602/files#diff-06a9f9e027535ab13c1ea18cd3bada61efd793c5c5f96024b96160021da314fd
https://github.com/simstudioai/sim/pull/8602/files#diff-06a9f9e027535ab13c1ea18cd3bada61efd793c5c5f96024b96160021da314fd
https://github.com/simstudioai/sim/pull/8602/files#diff-06a9f9e027535ab13c1ea18cd3bada61efd793c5c5f96024b96160021da314fd
https://github.com/simstudioai/sim/pull/8602/files#diff-06a9f9e027535ab13c1ea18cd3bada61efd793c5c5f96024b96160021da314fd
https://github.com/simstudioai/sim/pull/8602/files#diff-06a9f9e027535ab13c1ea18cd3bada61efd793c5c5f96024b96160021da314fd
https://github.com/simstudioai/sim/pull/8602/files#diff-06a9f9e027535ab13c1ea18cd3bada61efd793c5c5f96024b96160021da314fd
https://github.com/simstudioai/sim/pull/8602/files#diff-06a9f9e027535ab13c1ea18cd3bada61efd793c5c5f96024b96160021da314fd
https://github.com/simstudioai/sim/pull/8602/files#diff-06a9f9e027535ab13c1ea18cd3bada61efd793c5c5f96024b96160021da314fd
https://github.com/simstudioai/sim/pull/8602/files#diff-06a9f9e027535ab13c1ea18cd3bada61efd793c5c5f96024b96160021da314fd
https://github.com/simstudioai/sim/pull/8602/files#diff-06a9f9e027535ab13c1ea18cd3bada61efd793c5c5f96024b96160021da314fd
https://github.com/simstudioai/sim/pull/8602/files#diff-06a9f9e027535ab13c1ea18cd3bada61efd793c5c5f96024b96160021da314fd
apps/sim/lib/tool-execution/application/execute-tool.tshttps://github.com/simstudioai/sim/pull/8602/files#diff-941ac7a3d6a065c6c8890fe4172ddf1898c5c1eaad611ed5a656049f14fe4a7b
View file https://github.com/simstudioai/sim/blob/e9567b63308d2120a0245245c5100d0380e4e110/apps/sim/lib/tool-execution/application/execute-tool.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8602/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8602/files#diff-941ac7a3d6a065c6c8890fe4172ddf1898c5c1eaad611ed5a656049f14fe4a7b
https://github.com/simstudioai/sim/pull/8602/files#diff-941ac7a3d6a065c6c8890fe4172ddf1898c5c1eaad611ed5a656049f14fe4a7b
https://github.com/simstudioai/sim/pull/8602/files#diff-941ac7a3d6a065c6c8890fe4172ddf1898c5c1eaad611ed5a656049f14fe4a7b
https://github.com/simstudioai/sim/pull/8602/files#diff-941ac7a3d6a065c6c8890fe4172ddf1898c5c1eaad611ed5a656049f14fe4a7b
https://github.com/simstudioai/sim/pull/8602/files#diff-941ac7a3d6a065c6c8890fe4172ddf1898c5c1eaad611ed5a656049f14fe4a7b
https://github.com/simstudioai/sim/pull/8602/files#diff-941ac7a3d6a065c6c8890fe4172ddf1898c5c1eaad611ed5a656049f14fe4a7b
https://github.com/simstudioai/sim/pull/8602/files#diff-941ac7a3d6a065c6c8890fe4172ddf1898c5c1eaad611ed5a656049f14fe4a7b
https://github.com/simstudioai/sim/pull/8602/files#diff-941ac7a3d6a065c6c8890fe4172ddf1898c5c1eaad611ed5a656049f14fe4a7b
Please reload this pagehttps://github.com/simstudioai/sim/pull/8602/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.