Skip to content

feat(codemode): add provider proxy tool#1529

Open
mattzcarey wants to merge 9 commits into
mainfrom
feat/codemode-providers-rebased
Open

feat(codemode): add provider proxy tool#1529
mattzcarey wants to merge 9 commits into
mainfrom
feat/codemode-providers-rebased

Conversation

@mattzcarey
Copy link
Copy Markdown
Contributor

@mattzcarey mattzcarey commented May 15, 2026

Summary

Add a provider-based proxy tool API to @cloudflare/codemode.

This introduces createProxyTool({ providers, executor }), a single model-facing tool that can discover provider capabilities and execute code against generated provider SDKs in the sandbox.

Providers are async functions, so users can pass them directly without awaiting first:

tools: {
  codemode: createProxyTool({
    executor,
    providers: [
      mcpProvider({ name: "github", connection, executor, snippets }),
      openApiProvider({ name: "repoApi", spec, request }),
      toolsetProvider({ name: "local", tools })
    ]
  })
}

The proxy tool supports:

{ search: "pull request" }
{ describe: "github.list_open_prs" }
{ execute: "async () => await github.list_open_prs({ owner, repo })" }

What changed

  • Added createProxyTool(...) to @cloudflare/codemode
  • Added provider helpers:
    • mcpProvider(...)
    • openApiProvider(...)
    • toolsetProvider(...)
  • Added provider-level instructions and snippets
  • Snippets run through the shared runCode(...) helper
  • Added a codemode-providers example demonstrating MCP + OpenAPI providers in one sandbox
  • Kept existing createCodeTool(...) behavior intact; this is additive

Verification

npm run build --workspace @cloudflare/codemode
npm run deploy --workspace @cloudflare/agents-codemode-providers-demo -- --dry-run

Open in Devin Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 15, 2026

⚠️ No Changeset found

Latest commit: 87ee7ae

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

View 5 additional findings in Devin Review.

Open in Devin Review

Comment on lines 17 to +37
} from "./json-schema-types";
export { normalizeCode } from "./normalize";
export { resolveProvider } from "./resolve";

export {
createProxyTool,
type CodeProvider,
type CreateProxyToolOptions,
type ProxyToolInput,
type ProxyToolOutput
} from "./proxy-tool";
export {
mcpProvider,
openApiProvider,
toolsetProvider,
type McpConnectionLike,
type OpenApiRequestOptions,
type ProviderOptions,
type ProviderSnippet,
type ProviderSnippetRecord
} from "./providers";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Missing changeset for new public API exports in packages/codemode

The PR adds multiple new public API exports to packages/codemode/src/index.ts — including runCode, createProxyTool, mcpProvider, openApiProvider, toolsetProvider, and associated types — as well as a new mcp-provider.ts entry module. Per the repository's AGENTS.md: "Changes to packages/ that affect the public API or fix bugs need a changeset." No changeset file was added in .changeset/.

(Refers to lines 1-37)

Prompt for agents
The PR adds new public exports to packages/codemode (runCode, createProxyTool, mcpProvider, openApiProvider, toolsetProvider, and new type exports) without a changeset file. Run `npx changeset` at the repo root and create a changeset for the @cloudflare/codemode package describing the new provider and proxy-tool APIs. This is required by the repo's AGENTS.md before merging.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@mattzcarey mattzcarey force-pushed the feat/codemode-providers-rebased branch from 88dce23 to 843d808 Compare May 18, 2026 16:45
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