Skip to content

Conversation

@kdcokenny
Copy link
Collaborator

@kdcokenny kdcokenny commented Jan 13, 2026

Summary

Removes the built-in Google authentication implementation in favor of the external opencode-antigravity-auth plugin.

Changes

  • Deleted: src/auth/antigravity/ (28 files), src/google-auth.ts, src/cli/commands/auth.ts
  • Modified: src/index.ts, src/cli/index.ts, src/cli/config-manager.ts, src/config/schema.ts
  • Documentation: Updated all READMEs to reference external plugin only

Breaking Change

The google_auth config option is removed. Users should install opencode-antigravity-auth for Gemini authentication.

Migration

  1. Remove google_auth from your config (if present)
  2. Install the external plugin: opencode plugin add opencode-antigravity-auth

Summary by cubic

Replaces the built-in Google (Antigravity OAuth) auth with the external opencode-antigravity-auth plugin. Breaking change: removes the google_auth config and all internal auth code.

  • Refactors

    • Remove src/auth/antigravity/, src/google-auth.ts, and CLI auth commands.
    • Drop google_auth from the JSON schema and config parsing.
    • Clean up config-manager and plugin init to remove auth hooks.
    • Update READMEs to reference the external plugin and model overrides.
    • Remove google-auth export and build step from package.json.
  • Migration

    • Remove google_auth from oh-my-opencode.json.
    • Install the plugin: opencode plugin add opencode-antigravity-auth
    • If needed, override agent models to the plugin’s model names (see README).

Written for commit d99d79a. Summary will update on new commits.

- Delete src/auth/antigravity/ directory (28 files)
- Delete src/google-auth.ts standalone wrapper
- Delete src/cli/commands/auth.ts CLI command
- Remove google_auth config option from schema
- Update CLI to remove auth command registration
- Update config-manager to remove google_auth handling
- Update documentation to reference external opencode-antigravity-auth plugin only
- Regenerate JSON schema

Users should install the opencode-antigravity-auth plugin for Gemini authentication.

BREAKING CHANGE: The google_auth config option is removed. Use the external plugin instead.
@kdcokenny kdcokenny force-pushed the refactor/remove-builtin-google-auth branch from da94d33 to 3afdaad Compare January 13, 2026 14:03
@code-yeongyu
Copy link
Owner

@sisyphus-dev-ai review

@sisyphus-dev-ai sisyphus-dev-ai added the sisyphus: working Sisyphus is currently working on this label Jan 13, 2026
@sisyphus-dev-ai
Copy link
Collaborator

PR Review: Refactor to Remove Built-in Google Auth

Overview

This PR successfully removes the built-in Google Antigravity OAuth authentication in favor of the external opencode-antigravity-auth plugin. The core changes are solid, but there are several leftover files and references that need cleanup.


✅ What's Done Well

  1. Config Schema: Properly removed google_auth field from Zod schema and JSON schema
  2. CLI Commands: Successfully removed auth commands (list, remove) from CLI entry point
  3. Main Plugin: Properly removed googleAuthHooks initialization from src/index.ts
  4. Config Manager: Cleaned up all google_auth detection and generation logic
  5. Documentation: Updated consistently across all language versions (EN, JA, ZH-CN)
  6. Build Verification: Schema generation and TypeScript compilation pass successfully ✓

❌ Critical Issues - Dead Code Not Removed

1. Entire src/auth/ directory still exists (28 files, ~10k+ lines)

The complete Antigravity OAuth implementation is still in the repository:

src/auth/
├── AGENTS.md
└── antigravity/
    ├── plugin.ts              # Main plugin (554 lines)
    ├── oauth.ts               # OAuth flow (142 lines)
    ├── fetch.ts               # Token management (798 lines)
    ├── storage.ts             # Account storage (122 lines)
    ├── request.ts, response.ts, thinking.ts, etc.
    └── *.test.ts              # 9 test files

Action Required: Delete the entire src/auth/ directory

2. src/google-auth.ts still exists

This is a wrapper that exports createGoogleAntigravityAuthPlugin:

// src/google-auth.ts
import { createGoogleAntigravityAuthPlugin } from "./auth/antigravity"
export default createGoogleAntigravityAuthPlugin

Action Required: Delete src/google-auth.ts

3. src/cli/commands/auth.ts still exists

CLI commands for auth management (94 lines). Already removed from cli/index.ts but file remains:

// src/cli/commands/auth.ts
import { loadAccounts, saveAccounts } from "../../auth/antigravity/storage"
export async function listAccounts(): Promise<number> { ... }
export async function removeAccount(indexOrEmail: string): Promise<number> { ... }

Action Required: Delete src/cli/commands/auth.ts

4. package.json still references removed code

Two issues in package.json:

Line 21-22 - Exports section:

"./google-auth": {
  "import": "./dist/google-auth.js"
}

Line 26 - Build script:

"build": "bun build src/index.ts src/google-auth.ts --outdir dist ..."

Action Required:

  • Remove ./google-auth export from package.json exports
  • Remove src/google-auth.ts from build script

Impact Assessment

Severity: Medium

  • ✅ Functionality: Code builds and works correctly
  • ❌ Dead Code: ~28 unused files (~10k+ lines)
  • ❌ Maintenance: Confusing for contributors (is auth built-in or not?)
  • ❌ Package Size: Ships unused code to npm
  • ❌ Build System: References non-functional entry points

Recommended Actions

  1. Delete src/auth/ directory entirely
  2. Delete src/google-auth.ts
  3. Delete src/cli/commands/auth.ts
  4. Update package.json:
    • Remove ./google-auth from exports
    • Remove src/google-auth.ts from build script

Verification Steps After Changes

# 1. Verify no auth references remain
grep -r "google_auth" src/
grep -r "createGoogleAntigravityAuthPlugin" src/
grep -r "from.*auth/antigravity" src/

# 2. Verify build still works
bun run build

# 3. Verify types are clean
bun run typecheck

# 4. Verify CLI works
bunx oh-my-opencode doctor

Summary

The core refactoring is solid and well-executed. The remaining work is straightforward cleanup to remove dead code. Once these files are deleted and package.json is updated, this PR will be ready to merge.

Great work on the refactor! 🎉

@sisyphus-dev-ai sisyphus-dev-ai removed the sisyphus: working Sisyphus is currently working on this label Jan 13, 2026
@kdcokenny
Copy link
Collaborator Author

@sisyphus-dev-ai review

@kdcokenny kdcokenny marked this pull request as ready for review January 13, 2026 16:56
@sisyphus-dev-ai sisyphus-dev-ai added the sisyphus: working Sisyphus is currently working on this label Jan 13, 2026
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 40 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@sisyphus-dev-ai
Copy link
Collaborator

✅ Updated Review: All Issues Resolved!

Summary

Excellent work! All critical issues from the previous review have been successfully addressed. This PR is now ready to merge.


✅ What Was Fixed

1. Dead Code Removed

All the problematic files and directories have been deleted:

  • src/auth/ directory (~28 files, ~10k+ lines) - DELETED
  • src/google-auth.ts - DELETED
  • src/cli/commands/auth.ts - DELETED

2. package.json Cleaned Up

Both issues in package.json have been resolved:

  • Exports section: Removed ./google-auth export entry
  • Build script: Removed src/google-auth.ts from build command

3. No Leftover References

Verified via grep that no stray references remain:

grep -r "google_auth" src/          # NO MATCHES
grep -r "createGoogleAntigravityAuthPlugin" src/  # NO MATCHES
grep -r "auth/antigravity" src/     # NO MATCHES

4. Build & Type Checks Pass

✓ bun run build       # Success (497 modules bundled)
✓ bun run typecheck   # Success (no type errors)

📊 Impact Assessment

Area Status Notes
Functionality ✅ Pass Builds and type checks successfully
Dead Code ✅ Resolved All unused files removed (~10k+ lines)
Maintainability ✅ Resolved Clear separation: auth is now external plugin only
Package Size ✅ Resolved No longer ships unused auth code to npm
Build System ✅ Resolved No references to removed entry points

🎉 Conclusion

This refactor is complete and well-executed. The built-in Google auth has been successfully removed in favor of the external opencode-antigravity-auth plugin. All dead code is gone, the build system is clean, and everything compiles without errors.

Ready to merge! 🚀

@sisyphus-dev-ai sisyphus-dev-ai removed the sisyphus: working Sisyphus is currently working on this label Jan 13, 2026
@kdcokenny kdcokenny merged commit f2dc61f into dev Jan 13, 2026
3 checks passed
@kdcokenny kdcokenny deleted the refactor/remove-builtin-google-auth branch January 13, 2026 17:04
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.

4 participants