[RFC] OpenCode 2 plugin API support - #32
AlexanderWillner wants to merge 6 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Default LiteLLM chat models to explicit text-only modalities when capability metadata is absent, and invalidate stale model caches. Add regression coverage for OpenCode 2 discovery and cache upgrades.
Explain the conservative default for LiteLLM models without modality metadata and record the fix in the Unreleased changelog.
|
Independently verified the loader contract behind this PR's hybrid approach on two real runtimes (probe plugins under Verification result
Maintainer questions
The modality fix (always emit |
Summary
This PR adds OpenCode 2 plugin API support while retaining the existing OpenCode 1 server entrypoint.
It also fixes modality discovery for LiteLLM chat models. When LiteLLM does not report capability metadata, the plugin now registers the model as text-only instead of relying on OpenCode's image-capable fallback. The model cache version is incremented so stale entries are refreshed after the upgrade.
Type of change
Checklist
npm run typecheckpassesnpm testpassesCHANGELOG.mdupdated under## [Unreleased]How was this tested?
npm test: 67 tests passednpm run typecheckgit diff --checkmmprojbackend error or retry loopThe model catalog now reports
level-1-lokalwithinput: ["text"]andoutput: ["text"]when capability metadata is absent. A route with a working multimodal projector can opt in withmodelCapabilities: { "model-id": { "supports_vision": true } }.Maintainer questions
@opencode/pluginthe preferred dependency and API surface for V2 plugins?/connectbehavior?Related to #31. This RFC intentionally does not close the issue.