Skip to content

Conversation

@tsanva
Copy link
Contributor

@tsanva tsanva commented Dec 25, 2025

Summary

  • Remove the api: "antigravity" field from ANTIGRAVITY_PROVIDER_CONFIG that was being written to ~/.config/opencode/opencode.json
  • This field causes authentication failures with the opencode-antigravity-auth plugin

Related Issue

Fixes: NoeFabris/opencode-antigravity-auth#49

Multiple users confirmed that removing this field manually resolves the authentication issue.

The api: "antigravity" field being added to opencode.json causes
authentication failures with the antigravity plugin.

Fixes: NoeFabris/opencode-antigravity-auth#49
Copilot AI review requested due to automatic review settings December 25, 2025 00:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses an authentication issue by removing the api: "antigravity" field from the Google provider configuration in ANTIGRAVITY_PROVIDER_CONFIG. According to the linked issue, this field was causing authentication failures with the opencode-antigravity-auth plugin, and multiple users confirmed that manually removing it resolved the problem.

  • Removes the problematic api: "antigravity" field from the Google provider configuration
  • Fixes authentication failures for users of the opencode-antigravity-auth plugin

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 363 to 367
google: {
name: "Google",
api: "antigravity",
// NOTE: opencode-antigravity-auth expects full model specs (name/limit/modalities).
// If these are incomplete, models may appear but fail at runtime (e.g. 404).
models: {
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of the api: "antigravity" field creates an inconsistency with CODEX_PROVIDER_CONFIG, which still includes api: "codex" on line 408. While the PR description indicates this field causes authentication issues with the opencode-antigravity-auth plugin, the same field pattern exists in the codex configuration. Consider documenting why the field is removed here but retained for codex, or verify if the codex auth plugin has similar compatibility concerns.

Copilot uses AI. Check for mistakes.
@code-yeongyu
Copy link
Owner

@sisyphus-dev-ai review and please look at external sources too if required

@sisyphus-dev-ai
Copy link
Collaborator

👋 Hey @code-yeongyu! I'm on it...

@sisyphus-dev-ai
Copy link
Collaborator

✅ Review Complete

Summary: This is a clean, validated fix that resolves authentication failures for Antigravity users.


🔍 Analysis

Problem Confirmed:

  • The api: "antigravity" field written to ~/.config/opencode/opencode.json causes TypeError [ERR_INVALID_URL] when using opencode-antigravity-auth
  • NoeFabris/opencode-antigravity-auth#49 has 10 comments from multiple users confirming the issue
  • Users manually removing the field fixed authentication immediately

Change Impact:

  • ✅ Surgical 1-line deletion from ANTIGRAVITY_PROVIDER_CONFIG
  • ✅ No other code references this field (verified via grep)
  • ✅ Tests still pass (config-manager.test.ts doesn't validate api field)
  • ✅ Only affects new installations/config generation

Code Quality:

  • Clean, minimal change
  • No breaking changes to existing users (they already have configs)
  • Aligns with external plugin expectations

📝 Observations

CODEX_PROVIDER_CONFIG keeps api: "codex":

const CODEX_PROVIDER_CONFIG = {
  openai: {
    api: "codex",  // Still present
    // ...
  }
}

This suggests different auth plugins have different requirements. The opencode-openai-codex-auth plugin may need this field, while opencode-antigravity-auth does not.


✅ Recommendation

APPROVE & MERGE

This fix:

  • Solves a real user problem (auth failures)
  • Has been validated by multiple users in the wild
  • Introduces zero risk to existing functionality
  • Follows the principle of least surprise (plugin expectations)

Post-merge suggestion:
Consider adding a comment explaining why CODEX has api but Antigravity doesn't:

export const ANTIGRAVITY_PROVIDER_CONFIG = {
  google: {
    name: "Google",
    // NOTE: Do not add api field - opencode-antigravity-auth plugin
    // does not expect it and will fail with ERR_INVALID_URL
    models: { /* ... */ }
  }
}

Great work, @tsanva! 🎉

@code-yeongyu
Copy link
Owner

@sisyphus-dev-ai i am not sure he signed cla, can you please check?

@sisyphus-dev-ai
Copy link
Collaborator

👋 Hey @code-yeongyu! I'm on it...

@sisyphus-dev-ai
Copy link
Collaborator

CLA Status Check ✅

Author: @tsanva (vasant)

CLA Signed: ✅ Yes

Details:

The contributor has signed the CLA and is cleared to contribute! 🎉

@code-yeongyu
Copy link
Owner

@sisyphus-dev-ai please merge this

@sisyphus-dev-ai
Copy link
Collaborator

👋 Hey @code-yeongyu! I'm on it...

@sisyphus-dev-ai sisyphus-dev-ai merged commit 84b1634 into code-yeongyu:dev Dec 25, 2025
9 checks passed
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.

[BUG] TypeError [ERR_INVALID_URL]: fetch() URL is invalid when using Antigravity models via oh-my-opencode

3 participants