Skip to content

Conversation

Copy link

Copilot AI commented Jan 17, 2026

OpenCode v1.1.25's @opencode-ai/plugin requires [email protected], but this plugin depended on zod@^3.24.0. Since zod v3 and v4 are incompatible major versions, package managers cannot resolve this conflict, causing installation failures.

Changes

  • Dependencies: Upgraded zod from ^3.24.0 to ^4.0.0 and zod-to-json-schema to ^3.25.1 (supports both v3 and v4)
  • Schema generation: Replaced zodToJsonSchema() library call with zod v4's native toJSONSchema() method
  • Version: Bumped to 1.3.1
- import { zodToJsonSchema } from "zod-to-json-schema";
- const jsonSchema = zodToJsonSchema(AntigravityConfigSchema, {
-   name: "AntigravityConfig",
-   $refStrategy: "none",
- }) as Record<string, unknown>;
+ // Use zod v4's built-in toJSONSchema method
+ const jsonSchema = AntigravityConfigSchema.toJSONSchema() as Record<string, unknown>;

All tests pass. No breaking changes to plugin API or behavior.

Original prompt

This section details on the original issue you should resolve

<issue_title>Dependency Conflict: Plugin incompatible with OpenCode v1.1.25 due to zod version mismatch</issue_title>
<issue_description># Dependency Conflict: Plugin incompatible with OpenCode v1.1.25 due to zod version mismatch

Summary

The plugin [email protected] is incompatible with OpenCode v1.1.25 because it requires zod@^3.24.0, while OpenCode's core @opencode-ai/[email protected] requires [email protected]. This creates an unresolvable dependency conflict that prevents OpenCode from starting.

Environment

  • Plugin Version: 1.2.8
  • OpenCode Version: 1.1.25
  • Package Manager: Bun v1.3.5
  • Operating System: macOS (Darwin 25.2.0) ARM64

The Conflict

Current Dependencies

[email protected] requires zod@^3.24.0
@opencode-ai/[email protected] (OpenCode core) requires [email protected]

Why This Is a Problem

  • zod v3.x and v4.x are major breaking changes - They cannot be resolved simultaneously in the same dependency tree
  • OpenCode binary has plugin version hardcoded - Users cannot easily upgrade to a different version
  • Bun install fails - Cannot resolve the dependency conflict

Error Message

BunInstallFailedError for opencode-antigravity-auth version 1.2.8

Root Cause

OpenCode v1.1.25 has [email protected] hardcoded in its binary, and when it tries to install dependencies automatically, the conflicting zod versions cause installation to fail.

Related Issues

Proposed Solution

Option 1: Upgrade zod to v4.x (Recommended)

Update the plugin to use zod@^4.0.0 to match OpenCode's requirements.

Benefits:

  • Compatible with OpenCode v1.1.25
  • Latest zod version with improved performance and features
  • Resolves the conflict completely

Option 2: Release v1.2.9 with zod v4

Keep v1.2.8 for backward compatibility, but release v1.2.9 with zod v4 support.

This allows:

  • Older OpenCode versions to continue using v1.2.8
  • OpenCode v1.1.25 to update to v1.2.9

Option 3: Peer Dependency

Make zod a peer dependency to allow consumers to choose the version.

Impact

Severity: High - Makes plugin completely unusable with current OpenCode version

Affected Users: Anyone using OpenCode v1.1.25 with this plugin

Additional Context

This plugin is essential for Google OAuth authentication (access to Gemini 3 Pro and Claude 4.5), so fixing this compatibility issue is critical for users who need Google authentication.

Thank you for maintaining this plugin!
</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 17, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI changed the title [WIP] Fix dependency conflict with zod version in OpenCode plugin Upgrade zod to v4 for OpenCode v1.1.25 compatibility Jan 17, 2026
Copilot AI requested a review from NoeFabris January 17, 2026 19:50
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.

Dependency Conflict: Plugin incompatible with OpenCode v1.1.25 due to zod version mismatch

2 participants