Skip to content

feat: bundle AnthropicAuthPlugin and remove IDE integration#284

Merged
shuv1337 merged 5 commits intointegrationfrom
shuvcode-dev
Jan 9, 2026
Merged

feat: bundle AnthropicAuthPlugin and remove IDE integration#284
shuv1337 merged 5 commits intointegrationfrom
shuvcode-dev

Conversation

@shuv1337
Copy link
Collaborator

@shuv1337 shuv1337 commented Jan 9, 2026

Summary

This PR bundles the AnthropicAuthPlugin directly in the codebase and removes the IDE integration feature from the TUI.

Changes

Features

  • Bundle AnthropicAuthPlugin directly in the codebase instead of loading externally

Refactoring

  • Remove IDE integration from TUI (connection handling, sync context, dialogs)
  • Remove IDE-related test files
  • Update generated SDK types to remove IDE-related type definitions

Code Removed

  • packages/opencode/src/ide/ - IDE connection and integration module
  • packages/opencode/src/cli/cmd/tui/component/dialog-ide.tsx - IDE dialog component
  • packages/opencode/test/ide/ide.test.ts - IDE integration tests

Breaking Changes

  • IDE integration feature is no longer available in the TUI
  • IDE-related SDK types have been removed

Testing

Existing tests cover changes. IDE-specific tests were removed as the feature is no longer present.

Greptile Overview

Greptile Overview

Greptile Summary

Bundles the AnthropicAuthPlugin directly in the codebase instead of loading it externally from npm, and removes the IDE integration feature from the TUI. The plugin bundling change moves the Anthropic authentication logic (OAuth flows, token refresh, API key creation) into a local module loaded at startup. The IDE integration removal eliminates connection handling, selection syncing, status displays, and related UI components across the TUI.

Confidence Score: 1/5

  • Contains a runtime error that will break the /ide command for users
  • The autocomplete.tsx file retains a /ide command entry (lines 440-443) that references the removed IDE integration. When users type /ide, it will trigger ide.list which no longer exists since all IDE-related code was deleted. This will cause a runtime error and break user workflows.
  • packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx requires immediate attention to remove the orphaned /ide command

Important Files Changed

File Analysis

Filename Score Overview
packages/opencode/src/plugin/builtin/anthropic-auth.ts 4/5 Adds bundled AnthropicAuthPlugin with OAuth flow, token refresh, and API key creation methods
packages/opencode/src/plugin/index.ts 4/5 Updates plugin loader to initialize bundled AnthropicAuthPlugin directly instead of fetching from npm
packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx 1/5 Contains orphaned /ide command reference (lines 440-443) that triggers non-existent ide.list command

Sequence Diagram

sequenceDiagram
    participant User
    participant TUI
    participant PluginLoader
    participant AnthropicAuthPlugin
    participant AnthropicAPI

    Note over PluginLoader,AnthropicAuthPlugin: Plugin Bundling (NEW)
    User->>TUI: Start Application
    TUI->>PluginLoader: Initialize plugins
    PluginLoader->>AnthropicAuthPlugin: Load bundled plugin directly
    AnthropicAuthPlugin-->>PluginLoader: Return auth hooks
    
    Note over User,AnthropicAPI: OAuth Authentication Flow
    User->>TUI: Select "Claude Pro/Max"
    TUI->>AnthropicAuthPlugin: authorize("max")
    AnthropicAuthPlugin->>AnthropicAPI: Generate PKCE challenge
    AnthropicAuthPlugin-->>User: Display authorization URL
    User->>AnthropicAPI: Authorize via browser
    User->>TUI: Paste authorization code
    TUI->>AnthropicAuthPlugin: exchange(code, verifier)
    AnthropicAuthPlugin->>AnthropicAPI: POST /v1/oauth/token
    AnthropicAPI-->>AnthropicAuthPlugin: Return tokens
    AnthropicAuthPlugin-->>TUI: Return credentials
    
    Note over TUI,AnthropicAPI: API Requests with Token Refresh
    TUI->>AnthropicAuthPlugin: fetch(request)
    AnthropicAuthPlugin->>AnthropicAuthPlugin: Check token expiry
    alt Token expired
        AnthropicAuthPlugin->>AnthropicAPI: Refresh token
        AnthropicAPI-->>AnthropicAuthPlugin: New access token
    end
    AnthropicAuthPlugin->>AnthropicAPI: API request with Bearer token
    AnthropicAPI-->>AnthropicAuthPlugin: Response
    AnthropicAuthPlugin-->>TUI: Transformed response
Loading

Important Files Changed

File Analysis

Filename Score Overview
packages/opencode/src/plugin/builtin/anthropic-auth.ts 4/5 Adds bundled AnthropicAuthPlugin with OAuth flow, token refresh, and API key creation methods
packages/opencode/src/plugin/index.ts 4/5 Updates plugin loader to initialize bundled AnthropicAuthPlugin directly instead of fetching from npm
packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx 1/5 Contains orphaned /ide command reference (lines 440-443) that triggers non-existent ide.list command

Sequence Diagram

sequenceDiagram
    participant User
    participant TUI
    participant PluginLoader
    participant AnthropicAuthPlugin
    participant AnthropicAPI

    Note over PluginLoader,AnthropicAuthPlugin: Plugin Bundling (NEW)
    User->>TUI: Start Application
    TUI->>PluginLoader: Initialize plugins
    PluginLoader->>AnthropicAuthPlugin: Load bundled plugin directly
    AnthropicAuthPlugin-->>PluginLoader: Return auth hooks
    
    Note over User,AnthropicAPI: OAuth Authentication Flow
    User->>TUI: Select "Claude Pro/Max"
    TUI->>AnthropicAuthPlugin: authorize("max")
    AnthropicAuthPlugin->>AnthropicAPI: Generate PKCE challenge
    AnthropicAuthPlugin-->>User: Display authorization URL
    User->>AnthropicAPI: Authorize via browser
    User->>TUI: Paste authorization code
    TUI->>AnthropicAuthPlugin: exchange(code, verifier)
    AnthropicAuthPlugin->>AnthropicAPI: POST /v1/oauth/token
    AnthropicAPI-->>AnthropicAuthPlugin: Return tokens
    AnthropicAuthPlugin-->>TUI: Return credentials
    
    Note over TUI,AnthropicAPI: API Requests with Token Refresh
    TUI->>AnthropicAuthPlugin: fetch(request)
    AnthropicAuthPlugin->>AnthropicAuthPlugin: Check token expiry
    alt Token expired
        AnthropicAuthPlugin->>AnthropicAPI: Refresh token
        AnthropicAPI-->>AnthropicAuthPlugin: New access token
    end
    AnthropicAuthPlugin->>AnthropicAPI: API request with Bearer token
    AnthropicAPI-->>AnthropicAuthPlugin: Response
    AnthropicAuthPlugin-->>TUI: Transformed response
Loading

- Add builtin/anthropic-auth.ts with full OAuth plugin implementation
- Load AnthropicAuthPlugin directly from code instead of npm
- Remove opencode-anthropic-auth@0.0.5 from BUILTIN list
- Keeps plugin bundling while removing external dependency
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link

greptile-apps bot commented Jan 9, 2026

Additional Comments (1)

packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx
The /ide command entry should be removed as IDE integration was removed in this PR. This will cause the command to trigger ide.list which no longer exists, resulting in a runtime error when users try to use this command.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx
Line: 440:443

Comment:
The `/ide` command entry should be removed as IDE integration was removed in this PR. This will cause the command to trigger `ide.list` which no longer exists, resulting in a runtime error when users try to use this command.

```suggestion
```

How can I resolve this? If you propose a fix, please make it concise.

The IDE integration was removed but the /ide slash command remained,
which would cause a runtime error when triggered.
@shuv1337 shuv1337 closed this in 60d61ea Jan 9, 2026
@shuv1337 shuv1337 merged commit 60d61ea into integration Jan 9, 2026
1 check 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.

1 participant