fix: pin AI SDK versions to exact versions for stability - #11
Conversation
Pin ai@5.0.76, @ai-sdk/openai@2.0.1, @ai-sdk/anthropic@2.0.1, @ai-sdk/react@2.0.1
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // Note: We inject deno-env.ts shim to handle Deno.env.get properly | ||
| // Simple replacement doesn't work because Deno.env.get(key) != process.env(key) | ||
| "Deno.cwd": "process.cwd", | ||
| }, | ||
| inject: [pathHelper.resolve(PROJECT_ROOT, "src/_shims/deno-env.ts")], |
There was a problem hiding this comment.
Provide deno-env shim referenced by esbuild inject
The new esbuild config injects src/_shims/deno-env.ts, but that file does not exist anywhere in the repo (rg deno-env only finds this reference and ls src/_shims shows only std shims). Running the scripts/build-npm.ts workflow will now fail when esbuild tries to resolve the injected path, so the npm build/publish pipeline is broken until a shim is added or the inject is removed.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // Note: We inject deno-env.ts shim to handle Deno.env.get properly | ||
| // Simple replacement doesn't work because Deno.env.get(key) != process.env(key) | ||
| "Deno.cwd": "process.cwd", | ||
| }, | ||
| inject: [pathHelper.resolve(PROJECT_ROOT, "src/_shims/deno-env.ts")], |
There was a problem hiding this comment.
Injects missing shim file in npm build
The new esbuild config injects src/_shims/deno-env.ts to handle Deno.env.get, but there is no such file anywhere under src/_shims (only std-front-matter.ts, std-fs.ts, std-path.ts). When scripts/build-npm.ts runs, esbuild will fail resolving the injected path before bundling, breaking the npm package build rather than improving stability.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR pins AI SDK dependencies to exact versions for consistent behavior across installations. The main changes update four AI SDK packages from version ranges to specific versions: ai@5.0.76, @ai-sdk/openai@2.0.1, @ai-sdk/anthropic@2.0.1, and @ai-sdk/react@2.0.1.
Key changes:
- Removed semver ranges (e.g.,
^5.0.0) in favor of exact version specifications - Updated version to
0.0.66in bothnpm/package.jsonanddeno.json - Added unrelated build configuration changes for Deno environment handling
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| scripts/build-npm.ts | Pins AI SDK versions to exact values and adds deno-env.ts shim injection (unrelated to version pinning) |
| npm/package.json | Updates package version to 0.0.66 and pins AI SDK dependencies to exact versions |
| deno.json | Updates package version to 0.0.66 and pins AI SDK import URLs to exact versions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Simple replacement doesn't work because Deno.env.get(key) != process.env(key) | ||
| "Deno.cwd": "process.cwd", | ||
| }, | ||
| inject: [pathHelper.resolve(PROJECT_ROOT, "src/_shims/deno-env.ts")], |
There was a problem hiding this comment.
The injected file src/_shims/deno-env.ts does not exist in the repository. This will cause the build to fail. Either create this file or remove the inject configuration if it's not needed for this PR.
| "ai/react": "https://esm.sh/@ai-sdk/react@2.0.1?deps=react@18.3.1,react-dom@18.3.1", | ||
| "@ai-sdk/react": "https://esm.sh/@ai-sdk/react@2.0.1?deps=react@18.3.1,react-dom@18.3.1", |
There was a problem hiding this comment.
This change downgrades @ai-sdk/react from version 2.0.59 to 2.0.1. While pinning to exact versions provides stability, downgrading may lose bug fixes and features from versions 2.0.2 through 2.0.59. Consider pinning to a more recent version (e.g., 2.0.59) unless there's a specific compatibility issue.
| "ai/react": "https://esm.sh/@ai-sdk/react@2.0.1?deps=react@18.3.1,react-dom@18.3.1", | |
| "@ai-sdk/react": "https://esm.sh/@ai-sdk/react@2.0.1?deps=react@18.3.1,react-dom@18.3.1", | |
| "ai/react": "https://esm.sh/@ai-sdk/react@2.0.59?deps=react@18.3.1,react-dom@18.3.1", | |
| "@ai-sdk/react": "https://esm.sh/@ai-sdk/react@2.0.59?deps=react@18.3.1,react-dom@18.3.1", |
| "@ai-sdk/react": "https://esm.sh/@ai-sdk/react@2.0.1?deps=react@18.3.1,react-dom@18.3.1", | ||
| "@ai-sdk/openai": "https://esm.sh/@ai-sdk/openai@2.0.1", | ||
| "@ai-sdk/anthropic": "https://esm.sh/@ai-sdk/anthropic@2.0.4", | ||
| "@ai-sdk/anthropic": "https://esm.sh/@ai-sdk/anthropic@2.0.1", |
There was a problem hiding this comment.
This change downgrades @ai-sdk/anthropic from version 2.0.4 to 2.0.1. While pinning to exact versions provides stability, downgrading may lose bug fixes and features from versions 2.0.2 through 2.0.4. Consider pinning to a more recent version (e.g., 2.0.4) unless there's a specific compatibility issue.
| "@ai-sdk/anthropic": "https://esm.sh/@ai-sdk/anthropic@2.0.1", | |
| "@ai-sdk/anthropic": "https://esm.sh/@ai-sdk/anthropic@2.0.4", |
Summary
ai:5.0.76@ai-sdk/openai:2.0.1@ai-sdk/anthropic:2.0.1@ai-sdk/react:2.0.1Test plan