Repository navigation
fix(runtime): bump @ag-ui/mcp-middleware to 0.0.2 and drop its client override - #7095
Conversation
… override `@ag-ui/[email protected]` declared `@ag-ui/client` as an exact dependency, so every install nested a second copy of the client beside the one the consumer already had. Because `@ag-ui/client` carries types, two copies are two distinct type identities, and a consumer passing a value into `CopilotRuntime` hit a type error naming a private `_debug` field and their own line rather than the duplication. `0.0.2` (ag-ui-protocol/ag-ui#2689) moves `@ag-ui/client` to a peer at `>=0.0.40`, matching the four sibling middlewares, so it resolves to the copy the host already has. This also removes the `@ag-ui/mcp-middleware>@ag-ui/client` override. That override was added in c3f7961 alongside the `0.0.1` dependency, as the in-repo workaround for the hard pin. With `0.0.2` it is not just redundant: it forces a stale `0.0.53` onto a peer the workspace satisfies at `0.0.59`, and the first resolve after the bump reported that as an unmet peer. The lockfile loses exactly one `@ag-ui/client` version, `0.0.53`. The other resolved versions are unchanged from main. Co-Authored-By: Claude Opus 5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe runtime package updates ChangesDependency and release-gate alignment
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The dependency and release-gate alignment is ready to merge with no unresolved material risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Size Change: 0 B Total Size: 1.68 MB ℹ️ View Unchanged
|
`verify:runtime-package` packs the runtime and installs it in a temp dir under `os.tmpdir()`. That directory never inherits the repo-root `.npmrc`, so the script writes its own `minimumReleaseAgeExclude` from `RELEASE_AGE_EXCLUDE` — a second copy of the same policy. #7093 added `@ag-ui/mcp-middleware` and `@ag-ui/mcp-apps-middleware` to `.npmrc` but not to that list, so the freshly published `@ag-ui/[email protected]` installed everywhere except inside the packed -runtime verification, which failed with: ERR_PNPM_NO_MATURE_MATCHING_VERSION Version 0.0.2 (released 22 minutes ago) of @ag-ui/mcp-middleware does not meet the minimumReleaseAge constraint The list's own comment already said to keep it in sync with `.npmrc`. A comment was the only thing holding the two together, and it did not hold, so this also adds a test asserting the two lists are identical. The test was mutation-checked in both directions: dropping an entry from either file fails it. Verified by running the failing step: `pnpm run verify:runtime-package` now exits 0 with "OK: packed runtime installs @copilotkit/channels-intelligence and loads through ESM and CJS". Co-Authored-By: Claude Opus 5 <[email protected]>
@copilotkit/a2ui-renderer
@copilotkit/agentcore-runner
@copilotkit/angular
@copilotkit/channels
@copilotkit/channels-core
@copilotkit/channels-discord
@copilotkit/channels-intelligence
@copilotkit/channels-slack
@copilotkit/channels-teams
@copilotkit/channels-telegram
@copilotkit/channels-ui
@copilotkit/channels-whatsapp
@copilotkit/core
@copilotkit/react-core
@copilotkit/react-native
@copilotkit/react-textarea
@copilotkit/react-ui
@copilotkit/runtime
@copilotkit/runtime-client-gql
@copilotkit/sdk-js
@copilotkit/shared
@copilotkit/sqlite-runner
@copilotkit/voice
@copilotkit/vue
@copilotkit/web-components
@copilotkit/web-inspector
commit: |
## What does this PR do? The runtime declares `pino: ^9.2.0`, but the root override makes workspace installs use 10.1.1. Consumers do not inherit that override, so the published package installs a different major from the one tested here. This changes the runtime dependency to `^10.1.1`, removes the Pino override, and updates the lockfile. The locked version stays at 10.1.1; all other resolutions are unchanged. The logger regression-test comment now describes the direct dependency. Pino 10 requires Node 20 or newer. This makes that dependency requirement explicit for runtime consumers as well as the workspace. ## Validation Checked on Node 22.23.2 with pnpm 10.33.4: - `pnpm install --frozen-lockfile` - Runtime build, including its 12 prerequisite tasks, through Nx. - Runtime type check through Nx. - Full runtime suite through Nx: 2,294 tests passed across 158 files, including the logger regression tests. - Packed the runtime and its workspace dependencies, then installed them in a separate consumer with no Pino override. It resolved Pino 10.3.1 from `^10.1.1`; CJS/ESM imports and actual logger creation passed. The consumer supplies the optional OpenAI peer (`4.104.0`) for the import check. - A clean merge with current main (`06b8901d4`) also passes dependency-reference checks and `pnpm install --frozen-lockfile --lockfile-only --ignore-scripts` across its 75 workspace projects. ## Related PRs and Issues Addresses the Pino half of #6423. The Next.js override cleanup is #7102, kept separate as requested in the issue. This PR does not change MCP dependencies; that follow-up was handled separately in #7095. ## Checklist - [x] I have read the contribution guide. - [x] The lockfile is included and the frozen install passes. - [x] Allow edits by maintainers. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Updated the runtime’s logging infrastructure to a newer supported release. - Removed an outdated version restriction to keep package resolution current. - **Tests** - Clarified regression-test documentation to reflect the current logging behavior. No user-facing functionality changes are included in this update. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What does this PR do? The bare `next: ^16.0.10` override forces Next 14 and 15 examples onto 16.1.3, while examples that declare Next 16 resolve to 16.2.3. This removes the bare override and replaces the overlapping ranges with two major-scoped security floors: - Next 15: `15.5.24` - Next 16: `16.3.3` These are the patched versions for [GHSA-2xp9-vwfh-vxw4](GHSA-2xp9-vwfh-vxw4) and [GHSA-p293-qw3h-jr36](GHSA-p293-qw3h-jr36). The rationale is recorded alongside the overrides. Neither advisory has a Next 14 fix. State Machine, Travel, and the v1 Pages Router example therefore explicitly declare `15.5.24`. The other nine manifests retain their existing Next ranges. This avoids keeping those three apps on an unsupported major or silently moving them across majors through another override. The updated lockfile covers all 12 Next importers and their compiler, image-processing, and peer dependencies. Unrelated package versions are preserved. The v1 Pages Router example also needs two compatibility adjustments when it actually runs on Next 15: bundle the SDK's global KaTeX styles and use the [documented ESM interoperability setting](https://nextjs.org/docs/messages/import-esm-externals) for `react-syntax-highlighter`/`refractor`. Its API route now lets `OpenAIAdapter` create the default client, avoiding a duplicate-OpenAI-type error that also reproduces with the previous Next 16.1.3 resolution. ## Validation Node 22.23.2 and pnpm 10.33.4: - `pnpm install --frozen-lockfile` passes for all 70 workspace projects. - Resolution audit: nine importers resolve to Next 15.5.24 and three to Next 16.3.3; every importer matches its declared major. - Nx production builds pass for State Machine, Travel, the v1 Pages Router example, `examples/v2/next-pages-router` (which uses the App Router), and Chat With Your Data (Next 16.3.3). - Changed source/configuration files pass formatting and lint checks. - A clean merge with current main (`06b8901d4`) also passes dependency-reference checks and `pnpm install --frozen-lockfile --lockfile-only --ignore-scripts` across its 75 workspace projects. Builds use a placeholder OpenAI key. Next reports the existing dynamic-import warning from the runtime's channel manager; the v1 Pages Router build also reports its warning about opting into `esmExternals: "loose"`. ## Related PRs and Issues Addresses the Next.js half of #6423. The separate Pino fix is #7089. This PR does not change Pino or MCP dependencies; the MCP follow-up was handled separately in #7095. ## Checklist - [x] I have read the contribution guide. - [x] The regenerated lockfile is included and the frozen install passes. - [x] Allow edits by maintainers. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Improvements** * Updated the Pages Router, state machine, and travel examples for compatibility with newer Next.js releases. * Improved the Pages Router example’s handling of module compatibility and syntax highlighting dependencies. * Simplified the example API configuration by using the adapter’s standard setup. * Updated supported Next.js version ranges and security-floor settings across the project. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Problem
@ag-ui/[email protected]declared@ag-ui/clientunderdependenciesat an exact version, so every install of@copilotkit/runtimenested a second copy of the client beside the one the consumer already had.That is not only install size.
@ag-ui/clientcarries types, and two copies are two distinct type identities, so a consumer who also declares@ag-ui/clientgets a type check that fails on a field unrelated to either version, naming a private property and their own line rather than the duplication:0.0.2(ag-ui-protocol/ag-ui#2689) moves@ag-ui/clienttopeerDependenciesat>=0.0.40, matching the four sibling middlewares, so it resolves to the copy the host already has.Why this touches three files
The pin bump is one line. The other change is removing this override from the root
package.json:It was added in c3f7961 alongside the
0.0.1dependency — that commit's own message reads "Add released@ag-ui/[email protected]dependency (lockfile +@ag-ui/clientoverride)". It was the in-repo workaround for the hard pin.With
0.0.2it is not merely redundant. It forces a stale0.0.53onto a peer this workspace satisfies at0.0.59, and the first resolve after the bump reported exactly that:Removing the override clears that line. Unrelated pre-existing warnings (langchain) are unaffected.
Testing
1. The duplicate is gone, verified against the published artifact. A real
npm installof@copilotkit/[email protected]alongside a directly declared@ag-ui/[email protected], with@ag-ui/[email protected]in place:One copy. Before the bump the same install produced two, the second being a nested
0.0.54.2. In this workspace, the lockfile loses exactly one version. Comparing resolved
@ag-ui/clientversions againstorigin/main:The remaining versions are unchanged from main — they come from examples pinning older published
@copilotkitpackages and are untouched here. The lockfile is a net 40 lines smaller.3. The middleware now shares the host's client. After a real
pnpm install:4. Clean install. A full
pnpm installcompletes with zero unmet peer warnings (Done in 38.8s).5. Types.
nx run @copilotkit/runtime:check-typespasses. This runs bothtsconfig.jsonandtsconfig.check.json, so test files are covered — relevant becausepackages/runtimeimportsMCPMiddlewareatchannel-manager.ts:21andagent-utils.ts:5, and a test mocks the module:6. Pre-commit suite.
test,publintandattwacross 25 projects and 27 dependent tasks:Successfully ran targets.Notes
No changeset: the release goes through workflow scopes.
This install only works today because #7093 added
@ag-ui/mcp-middlewareto theminimum-release-ageexemptions.0.0.2is hours old, and without that exemption pnpm hard-fails:This closes the middleware half of the duplicate-tree problem. The larger half — CopilotKit's own exact
@ag-ui/clientpins, which still nest a copy per package whenever a consumer declares a different version — is #6782.🤖 Generated with Claude Code
Summary by CodeRabbit