Conversation
Greptile SummaryThis PR adds the OpenCode Go channel (
Confidence Score: 3/5The new channel implementation is complete and consistent across backend and frontend, but the two-major-version icon package bump introduces a peer dependency conflict that could cause runtime rendering failures for icon components. The Go backend changes are clean and follow established patterns exactly. The concern is on the frontend: bumping @lobehub/icons from v3 to v5 just to import one new icon brings in a stated peer requirement of @lobehub/ui@^5.0.0, while the project only has @lobehub/ui@3.4.6. pnpm resolves this without error depending on strict-peer-deps config, but any icon that calls into v5-only @lobehub/ui APIs at runtime would silently break. All existing channel icons are also served by the upgraded package, so the blast radius is not limited to the OpenCode symbol alone. frontend/package.json and frontend/pnpm-lock.yaml — the @lobehub/icons upgrade and the resulting @lobehub/ui peer dependency mismatch deserve a second look before merging. Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant AxonHub
participant ChannelService
participant OpenAITransformer
participant OpenCodeAPI
Client->>AxonHub: POST /v1/chat/completions (model: opencode-go-v1)
AxonHub->>ChannelService: Route to opencode_go channel
ChannelService->>ChannelService: buildChannelWithTransformer (TypeOpencodeGo → OpenAI-compatible path)
ChannelService->>OpenAITransformer: NewOutboundTransformerWithConfig(PlatformOpenAI, baseURL)
AxonHub->>OpenAITransformer: Transform request
OpenAITransformer->>OpenCodeAPI: POST /chat/completions (Bearer key)
OpenCodeAPI-->>OpenAITransformer: Streaming response
OpenAITransformer-->>Client: Forwarded response
|
There was a problem hiding this comment.
Code Review
This pull request introduces the "OpenCode Go" channel provider, which includes updating the @lobehub/icons dependency, adding configuration settings, and updating the backend schema and logic to support the new provider. Feedback was provided to externalize the hardcoded base URL and default models for the new provider into environment variables to improve flexibility across different environments.
| channelType: 'opencode_go', | ||
| baseURL: 'https://opencode.ai/zen/go/v1', |
There was a problem hiding this comment.
Hardcoding baseURL and defaultModels directly within the CHANNEL_CONFIGS object can make it less flexible for different deployment environments (e.g., development, staging, production) or if these values need to be updated frequently. Consider externalizing these configuration values, perhaps through environment variables or a dedicated configuration service, to improve maintainability and adaptability.
| channelType: 'opencode_go', | |
| baseURL: 'https://opencode.ai/zen/go/v1', | |
| baseURL: process.env.OPENCODE_GO_BASE_URL || 'https://opencode.ai/zen/go/v1', | |
| defaultModels: process.env.OPENCODE_GO_DEFAULT_MODELS?.split(',') || ['opencode-go-v1'], |
No description provided.