fix: expose freellmpool models in OpenCode - #100
Merged
Conversation
Reviewer's GuideAdds a runtime config hook to the OpenCode freellmpool plugin that auto-registers the freellmpool provider and six routing alias models while preserving existing configuration and proxy auth, and updates docs/tests/smoke checks to cover the new behavior and authenticated config examples. Sequence diagram for OpenCode freellmpool runtime config hooksequenceDiagram
actor OpenCode
participant FreellmpoolPlugin
participant InstallProvider
OpenCode->>FreellmpoolPlugin: FreellmpoolPlugin({ client })
OpenCode->>FreellmpoolPlugin: config(config)
FreellmpoolPlugin->>InstallProvider: installProvider(config)
alt [config.disabled_providers includes freellmpool]
InstallProvider-->>FreellmpoolPlugin: return
else Provider_enabled
opt [config.enabled_providers exists]
InstallProvider->>config: enabled_providers.push("freellmpool")
end
InstallProvider->>config: config.provider.freellmpool ||= {}
InstallProvider->>config: provider.options.baseURL ||= BASE_URL + "/v1"
opt [PROXY_KEY is set]
InstallProvider->>config: provider.options.apiKey ||= PROXY_KEY
end
InstallProvider->>config: provider.options.headerTimeout ??= 600000
InstallProvider->>config: provider.options.timeout ??= 600000
InstallProvider->>config: provider.options.chunkTimeout ??= 120000
InstallProvider->>config: provider.models[id].name ||= PROVIDER_MODELS[id].name
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Revisit the
enabled_providershandling ininstallProvider— automatically pushingfreellmpoolinto an existing allowlist may be surprising for users who intend that list to remain explicit. - The defensive checks in
installProvider(forconfig,config.provider,provider.models, etc.) are quite repetitive; consider simplifying the control flow or extracting small helpers to make the mutation logic easier to follow and maintain.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Revisit the `enabled_providers` handling in `installProvider` — automatically pushing `freellmpool` into an existing allowlist may be surprising for users who intend that list to remain explicit.
- The defensive checks in `installProvider` (for `config`, `config.provider`, `provider.models`, etc.) are quite repetitive; consider simplifying the control flow or extracting small helpers to make the mutation logic easier to follow and maintain.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FREELLMPOOL_PROXY_KEYto OpenAI-compatible model calls as well as plugin toolsValidation
883 passedfull suite before the final docs-only regression additionopencode models freellmpool: six aliases visibleopencode run --model freellmpool/agent: pass402c97b80b219df5f61352454fd63ea69ee6b73fCloses #99
Summary by Sourcery
Expose the freellmpool provider and its routing aliases to OpenCode via a runtime config hook while keeping user configuration and authentication intact.
New Features:
Bug Fixes:
Enhancements:
opencode models freellmpool.Documentation:
Tests:
Chores: