Skip to content

fix: mark @cloudflare/ai-chat and @cloudflare/codemode as optional peer deps#916

Merged
threepointone merged 2 commits intomainfrom
fix-optional-peer-deps-ai-chat-codemode
Feb 15, 2026
Merged

fix: mark @cloudflare/ai-chat and @cloudflare/codemode as optional peer deps#916
threepointone merged 2 commits intomainfrom
fix-optional-peer-deps-ai-chat-codemode

Conversation

@threepointone
Copy link
Contributor

@threepointone threepointone commented Feb 15, 2026

Summary

Installing agents via pnpm (or npm) produces warnings about unmet peer dependencies for @cloudflare/ai-chat and @cloudflare/codemode. This happens because:

  1. agents lists @cloudflare/ai-chat and @cloudflare/codemode as required peer dependencies
  2. @cloudflare/ai-chat and @cloudflare/codemode each list agents as a peer dependency
  3. This creates a circular peer dependency loop, and since the ai-chat/codemode peers aren't marked optional, package managers warn on every install

These peer deps only exist to support deprecated backward-compat re-export shims (e.g. agents/ai-chat-agent re-exports from @cloudflare/ai-chat, agents/codemode/ai re-exports from @cloudflare/codemode). Most users of agents don't use these deprecated paths and shouldn't need to install ai-chat or codemode.

This PR adds both packages to peerDependenciesMeta with optional: true, matching the pattern already used for @ai-sdk/openai, @ai-sdk/react, @x402/*, and viem.

Test plan

  • Verify pnpm install no longer warns about unmet peer deps for ai-chat/codemode
  • CI passes (npm run check && npm run test)

Made with Cursor

…er deps

These packages are only needed for deprecated backward-compat re-exports
and should not produce unmet peer dependency warnings on install.

Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot
Copy link

changeset-bot bot commented Feb 15, 2026

🦋 Changeset detected

Latest commit: d690cc4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
agents Patch

Not sure what this means? Click here to learn what changesets are.

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 15, 2026

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/agents@916

commit: d690cc4

@threepointone threepointone merged commit 24e16e0 into main Feb 15, 2026
4 checks passed
@threepointone threepointone deleted the fix-optional-peer-deps-ai-chat-codemode branch February 15, 2026 21:05
@github-actions github-actions bot mentioned this pull request Feb 15, 2026
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