GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(context-dev): add Context.dev to hosted key rotation pool by waleedlatif1 · Pull Request #5576 · simstudioai/sim

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

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

  • New feature

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
All reactions
  • 👍 1 reaction
@waleedlatif1
feat(context-dev): add Context.dev to hosted key rotation pool
cd882b5
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.
@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 10, 2026 10:46pm

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cursor

cursor Bot commented Jul 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Jul 10, 2026
View reviewed changes
Comment thread apps/sim/tools/context_dev/hosting.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@greptile-apps

greptile-apps Bot commented Jul 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot]
greptile-apps Bot reviewed Jul 10, 2026
View reviewed changes
Comment thread apps/sim/tools/context_dev/hosting.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/tools/context_dev/hosting.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1

waleedlatif1 commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1

waleedlatif1 commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

@cursor review

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Jul 10, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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.

All reactions
@waleedlatif1 waleedlatif1 mentioned this pull request Jul 10, 2026
v0.7.29: GLM, ui and ux improvements #5567
Merged
@waleedlatif1
waleedlatif1 merged commit 65b1ca1 into staging Jul 10, 2026
29 of 30 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1
waleedlatif1 deleted the worktree-feat+context-dev-hosted-keys branch July 10, 2026 22:58

This branch was previously deployed

1 inactive deployment
Preview — cd882b5a Deployed Jul 10, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@greptile-apps greptile-apps[bot] greptile-apps[bot] left review comments
@cursor cursor[bot] cursor[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

1 participant

@waleedlatif1
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.