GeezerVison is showing github.com — feat(context-dev): add Context.dev to hosted key rotation pool by waleedlatif1 · Pull Request #5576 · simstudioai/sim
Conversation
Summary
- Add Context.dev to the hosted-key mechanism, mirroring Exa's pattern exactly
- New
apps/sim/tools/context_dev/hosting.ts shared helper: CONTEXT_DEV_API_KEY env prefix (_COUNT + _1..N rotation), byokProviderId: 'context_dev', per_request rate limit (60/min)
- All 22
context_dev_* tools wired with hosting: contextDevHosting<...>()
- Cost is computed from each response's actual
credits_consumed (already surfaced as output.creditsConsumed) rather than a hardcoded per-endpoint guess — more accurate than static estimates since Context.dev reports real usage per call
context_dev added to BYOKProviderId, byokProviderIdSchema, and the Settings → BYOK UI (Search & web section, next to Exa/Firecrawl)
- Block's API Key field gets
hideWhenHosted: true — no operation split needed since all 22 ops support hosted keys (unlike Exa, which excludes research)
.env.example documents CONTEXT_DEV_API_KEY_COUNT/1/2
Type of Change
Testing
bun run check:api-validation passes
bunx tsc --noEmit clean on touched files (1 pre-existing unrelated error elsewhere on staging)
bunx vitest run tools/context_dev/ tools/index.test.ts blocks/blocks.test.ts — 168/168 passing
bun run lint clean
Checklist
- Code follows project style guidelines
- Self-reviewed my changes
- Tests added/updated and passing
- No new warnings introduced
- I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
greptile-apps[bot] reacted with thumbs up emoji
Wires all 22 context_dev tools into the same hosted-key mechanism as
Exa: CONTEXT_DEV_API_KEY_COUNT/1..N rotation, BYOK provider
registration, and hideWhenHosted on the block's API key field. Cost
is read directly from each response's reported credits_consumed
rather than estimated per endpoint.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
| Project |
Deployment |
Actions |
Updated (UTC) |
| docs |
Skipped |
|
Jul 10, 2026 10:46pm |

|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
cursor
Bot
commented
Jul 10, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
PR Summary
Medium Risk
Touches hosted-key billing and API key resolution for a large tool surface; misconfigured pricing or key rotation could affect cost accounting or outbound calls, but the pattern matches existing providers like Exa.
Overview
Adds hosted API key support for Context.dev so deployments can supply CONTEXT_DEV_API_KEY_COUNT / _1..N keys and workflows can run without users entering a key when hosting is enabled.
A shared contextDevHosting() helper wires env prefix, BYOK provider context_dev, 60/min per-request rate limiting, and usage-based pricing from each response’s creditsConsumed (not fixed per-endpoint costs). All 22 Context.dev tools attach that hosting config.
BYOK is extended end-to-end: provider id in types and API contracts, Settings → BYOK under Search & web, and the Context.dev block API key field uses hideWhenHosted: true. .env.example documents the new env vars; hosting.test.ts covers pricing and hosting metadata.
Reviewed by Cursor Bugbot for commit cd882b5. Configure here.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Greptile Summary
This PR adds Context.dev to the hosted-key and BYOK flow. The main changes are:
- New Context.dev hosted-key helper with rotating environment keys.
- Hosted pricing based on reported
creditsConsumed.
- Context.dev BYOK provider support in contracts and Settings.
- Hosted-key wiring across the Context.dev tools.
- Hosted deployments hide the block-level Context.dev API key field.
Confidence Score: 5/5
This looks safe to merge.
- No blocking issues found in the changed code.
Important Files Changed
| Filename |
Overview |
| apps/sim/tools/context_dev/hosting.ts |
Adds the shared Context.dev hosted-key config, credit-based pricing, BYOK provider id, and rate limit settings. |
| apps/sim/tools/context_dev/*.ts |
Adds the Context.dev hosting helper to the tool configs. |
| apps/sim/blocks/blocks/context_dev.ts |
Hides the Context.dev API key field on hosted deployments. |
| apps/sim/lib/api/contracts/byok-keys.ts |
Adds context_dev to the BYOK provider schema. |
| apps/sim/app/workspace/[workspaceId]/settings/components/byok/byok.tsx |
Adds Context.dev to the BYOK Settings provider list. |
Reviews (2): Last reviewed commit: "feat(context-dev): add Context.dev to ho..." | Re-trigger Greptile
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
greptile-apps[bot] reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
cursor[bot] reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit cd882b5. Configure here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This branch was previously deployed
1 inactive
deployment
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|