Skip to content

fix(chat): hosted key execution via call-integration-tool#5745

Merged
icecrasher321 merged 2 commits into
stagingfrom
fix/superagent-hosted-key
Jul 17, 2026
Merged

fix(chat): hosted key execution via call-integration-tool#5745
icecrasher321 merged 2 commits into
stagingfrom
fix/superagent-hosted-key

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

Summary

Hosted key execution via call-integration-tool was not working because key not injected.

Type of Change

  • Bug fix

Testing

Tested manually

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)

@vercel

vercel Bot commented Jul 17, 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 17, 2026 8:59pm

Request Review

@cursor

cursor Bot commented Jul 17, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes copilot integration input schemas and required-field validation for API-key params on hosted deployments; behavior is scoped to schema generation with explicit edge cases for conditional hosting.

Overview
Fixes hosted-key integration tools in copilot by aligning gateway tool schemas with server-side key injection so call-integration-tool no longer demands an API key the model cannot supply.

createUserToolSchema gains hostedKeySupport. On hosted deployments, copilot integration schemas are built with hostedKeySupport: isHosted from buildIntegrationToolSchemas. For tools with unconditional hosting config, the configured apiKeyParam stays visible for optional BYOK but is removed from required, with copy noting Sim’s hosted key. Conditional hosting.enabled tools, non-hosted tools, and self-hosted builds keep the key required as before.

Tests cover hosted vs self-hosted, conditional hosting, plain tools, and payload wiring.

Reviewed by Cursor Bugbot for commit ddb83c3. Configure here.

Comment thread apps/sim/tools/params.ts
@greptile-apps

greptile-apps Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates Copilot tool schemas to support server-injected hosted API keys. The main changes are:

  • Pass hosted deployment support into integration schema generation.
  • Make API keys optional for unconditionally hosted tools.
  • Keep API keys required for self-hosted, non-hosted, and conditionally hosted tools.
  • Add tests for the updated schema behavior.

Confidence Score: 5/5

No additional blocking issue qualifies for this follow-up review.

  • No distinct production breakage was found beyond the behavior already covered by earlier feedback.

Important Files Changed

Filename Overview
apps/sim/lib/copilot/chat/payload.ts Passes hosted-key support into Copilot integration schema generation.
apps/sim/tools/params.ts Adds hosted-key schema options and relaxes required API keys for unconditionally hosted tools.
apps/sim/lib/copilot/chat/payload.test.ts Updates schema-construction expectations for the hosted-key option.
apps/sim/tools/params.test.ts Adds coverage for hosted, self-hosted, conditional, and non-hosted key requirements.

Reviews (2): Last reviewed commit: "fix optional hosted key" | Re-trigger Greptile

Comment thread apps/sim/tools/params.ts Outdated
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

bugbot run

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 ddb83c3. Configure here.

@icecrasher321
icecrasher321 merged commit b2d9c02 into staging Jul 17, 2026
20 checks passed
@icecrasher321
icecrasher321 deleted the fix/superagent-hosted-key branch July 17, 2026 21:08
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