fix(desktop): packaged server ships zod for @cursor/sdk 1.0.38#25841
Problem
Since #21074 bumped @cursor/sdk to 1.0.38, the packaged desktop backend exits at startup with Cannot find module 'zod/v4' (required from app.asar/node_modules/@cursor/sdk). 1.0.38 moved zod to a peer dependency; zod is a runtime external of the server bundle, but the desktop stage only receives externals that apps/server lists, so app.asar ships @cursor/sdk without zod. Details and the stack trace are in #25840.
Change
apps/serverdepends onzoddirectly (^4.6.5, the version already in the lockfile; the lockfile gains only the importer entry).- A test in
scripts/lib/cli-external-packages.test.tswalks the staged externals fromapps/server's dependencies through theirdependenciesandoptionalDependencies, and fails when a non-optional peer of a staged package is not itself staged. The next SDK bump that turns a dependency into a peer fails here instead of in a packaged app.
Scope and approval
Fixes #25840 (not triaged yet). This is a one-line dependency fix for a startup crash that the next nightly from main would ship, plus the regression test for it, so I believe it fits the small, focused fix exception.
Verification
- The new test on
upstream/main(d033768ec7) without the fix fails with exactly one finding:["@cursor/sdk -> zod"]. With the fix,vp test run scripts/lib/cli-external-packages.test.ts: 12 passed. vp run check:changed: lint, knip, typecheck (36 packages), graphql and tests (20 files, 737 tests) pass; format passed aftervp fmt.- Packaged app: the same
apps/serverchange on a fork that mergedmainat6bbb2d8508. Before it, the macOS (Apple Silicon) desktop nightly's backend failed 12 times in a row with the error above. After it,app.asarcontainsnode_modules/zodbeside@cursor/sdkand the backend starts and serves HTTP 200. The fork's changes to the desktop packaging script are limited to dev signing and a locale. - Not checked: Linux and Windows packages, and the
npx t3CLI archive (same external selection, no electron-builder).
Claude Opus 5.5 (claude-opus-5-5) via Claude Code in T3 Code
Checks
Added 1 commit
- fix(desktop): packaged server ships zod for @cursor/sdk 1.0.38f9f42fd
Approvability
Verdict: Approved at f9f42fd
Macroscope's review found this PR approvable — This is a narrowly scoped dependency and lockfile update with test-only validation, confined to the repository’s ignored paths. It does not change product defaults or suppress static-analysis diagnostics; the runtime effect is limited to ensuring the packaged server includes its required dependency.
Notes:
- No code objects were reviewed. Approvability was decided on eligibility alone.
You can add or adjust custom eligibility rules. Learn more.
No actionable comments were generated in the recent review.
External image Recent review info
-
External image Run configuration
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: e5f2e5d
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
136f443a-4603-4e92-a9b4-ca9675d395e5
External image Commits
Reviewing files that changed from the base of the PR and between e5f2e5dbbc5c7864aefdeccaca18284d023edc37 and f9f42fdb2b41f81f8c5a4cd8b4271ad2f3b09da6.
External image Files ignored due to path filters: 1
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
External image Files selected for processing: 2
apps/server/package.jsonscripts/lib/cli-external-packages.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Walkthrough
The server package adds
zodas a dependency. A new test checks that staged runtime dependencies include required peer dependencies and ignores peers marked optional.Changes: Server peer dependency staging
Layer / File(s) Summary Declare and validate staged peer dependencies
apps/server/package.json,scripts/lib/cli-external-packages.test.tsThe server adds zod. The test follows staged packages’ dependencies and optional dependencies, and flags required peers that are not staged. Optional peers are excluded from missing-peer failures.Priority: External image Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related issues
pingdotgg/t3code#25840reports a packaged desktop backend failure caused by missingzod; this change adds the stated workaround and tests required peer staging.
Possibly related PRs
- pingdotgg/t3code#25103: It changes the dependency-closure test that this PR extends to check required peer dependencies.
Suggested reviewers:
juliusmarminge,t3dotgg
Merge Risk: External image Minimal · up to f9f42
No actionable merge-blocking issue was established for the dependency or its staging test. The change is ready for normal merge checks.
Pre-merge checks: Passed 4
Check name Status Explanation Title check Passed The title "fix(desktop): packaged server ships zod for @cursor/sdk1.0.38" is a conventional commit title that names the main change: the packaged desktop server now ships the zod dependency that@cur…Linked Issues check Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request. Description check Passed The pull request description includes all required sections: Problem, Change, Scope and approval, and Verification. It explains the startup failure, the dependency and test changes, the small-fix exce… Full details: Title check
Explanation
The title "fix(desktop): packaged server ships zod for
@cursor/sdk1.0.38" is a conventional commit title that names the main change: the packaged desktop server now ships the zod dependency that@cursor/sdk1.0.38 needs. The changeset adds zod (^4.6.5) to apps/server/package.json and adds a regression test in scripts/lib/cli-external-packages.test.ts. The title matches both parts. It is specific and under 70 characters.
Full details: Description check
Explanation
The pull request description includes all required sections: Problem, Change, Scope and approval, and Verification. It explains the startup failure, the dependency and test changes, the small-fix exception, detailed verification results, untested platforms, and the agent used.
Finishing Touches
🧪 Generate unit tests (beta)
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.