Skip to content

fix: avoid image fallback for text-only routes - #1

Closed
AlexanderWillner wants to merge 6 commits into
mainfrom
rfc/opencode-v2-plugin-api
Closed

AlexanderWillner wants to merge 6 commits into
mainfrom
rfc/opencode-v2-plugin-api

Conversation

@AlexanderWillner

Copy link
Copy Markdown
Owner

Summary

Fix OpenCode 2 model discovery so LiteLLM chat models without explicit modality metadata are registered as text-only. This prevents OpenCode's image-capable fallback from sending image parts to text-only routes and avoids repeated mmproj backend errors. The model cache is versioned so stale entries are refreshed after upgrade.

Type of change

  • 🐛 Bug fix (non-breaking)
  • ✨ New feature (non-breaking)
  • 💥 Breaking change
  • 📝 Documentation only
  • 🔧 Internal / refactor

Checklist

  • npm run typecheck passes
  • npm test passes
  • No new runtime dependencies
  • README updated for the behavior change
  • CHANGELOG.md updated under ## [Unreleased]
  • Commit messages follow Conventional Commits

How was this tested?

  • npm test - 67 tests passed
  • npm run typecheck
  • git diff --check
  • Live OpenCode 2 smoke test against the configured LiteLLM route: text completion succeeded and an image attachment no longer produced the mmproj backend error

Screenshots / logs (optional)

The model catalog now reports level-1-lokal with input: ["text"] and output: ["text"] when capability metadata is absent. Routes with a working multimodal projector can opt in with modelCapabilities: { "model-id": { "supports_vision": true } }.

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.
@AlexanderWillner

Copy link
Copy Markdown
Owner Author

Duplicate of the upstream PR yuseferi#32. Closing this accidentally created fork PR.

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