Skip to content

fix(agents): support configurable builtin models#4261

Draft
samwillis wants to merge 1 commit intomainfrom
samwillis/agents-model-selection
Draft

fix(agents): support configurable builtin models#4261
samwillis wants to merge 1 commit intomainfrom
samwillis/agents-model-selection

Conversation

@samwillis
Copy link
Copy Markdown
Contributor

@samwillis samwillis commented May 3, 2026

Summary

  • Add a built-in model catalog for Anthropic and OpenAI keys and expose model selection in Horton's creation schema.
  • Let Horton and Worker resolve the selected provider/model, including session-level reasoning effort for compatible OpenAI reasoning models.
  • Switch context tool schemas to TypeBox so OpenAI tool validation accepts them.

Looks like this:

image

Test plan

  • pnpm -C packages/agents test -- --run test/model-catalog.test.ts test/horton-model-selection.test.ts test/spawn-worker-tool.test.ts test/worker-least-privilege.test.ts
  • pnpm -C packages/agents build
  • Verified a GPT-5 Horton can reply locally with provider openai/model gpt-5

Made with Cursor

Allow Horton and Worker to use configured Anthropic or OpenAI models, including UI-selectable reasoning effort for compatible OpenAI reasoning models.

Co-authored-by: Cursor <cursoragent@cursor.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented May 3, 2026

Deploy Preview for electric-next ready!

Name Link
🔨 Latest commit b8aea1f
🔍 Latest deploy log https://app.netlify.com/projects/electric-next/deploys/69f71f4f5227cb0008132b04
😎 Deploy Preview https://deploy-preview-4261--electric-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 3, 2026

Codecov Report

❌ Patch coverage is 87.78626% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.31%. Comparing base (36a2c03) to head (b8aea1f).
⚠️ Report is 12 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/agents/src/model-catalog.ts 88.50% 10 Missing ⚠️
packages/agents/src/agents/worker.ts 70.00% 3 Missing ⚠️
packages/agents/src/bootstrap.ts 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4261      +/-   ##
==========================================
- Coverage   64.60%   61.31%   -3.29%     
==========================================
  Files         144      120      -24     
  Lines       19295    16897    -2398     
  Branches     4745     4169     -576     
==========================================
- Hits        12465    10360    -2105     
+ Misses       6827     6536     -291     
+ Partials        3        1       -2     
Flag Coverage Δ
packages/agents 58.89% <86.20%> (+4.49%) ⬆️
packages/agents-runtime 78.61% <100.00%> (ø)
packages/agents-server 66.03% <ø> (ø)
packages/agents-server-ui 0.00% <ø> (ø)
packages/electric-ax 38.59% <ø> (+0.62%) ⬆️
packages/experimental ?
packages/react-hooks ?
packages/start ?
packages/typescript-client ?
packages/y-electric ?
typescript 61.31% <87.78%> (-3.29%) ⬇️
unit-tests 61.31% <87.78%> (-3.29%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant