A single-file OpenCode plugin that gives text-only agents access to image inspection through an isolated vision model.
When asked to install this plugin:
-
Copy
vision-fallback.tsto one of these locations:~/.config/opencode/plugins/vision-fallback.ts <project>/.opencode/plugins/vision-fallback.ts -
Edit only the vision model configuration near the top of the plugin:
const VISION_MODEL = { providerID: "newapi", modelID: "MiniMax-M3", } as const
Both values must exactly match the provider and model IDs available in the user's OpenCode configuration.
-
Verify that the selected model supports image input.
For custom models, add or merge:
-
Add or merge the following permission without replacing the user's existing permission rules:
"permission": { "vision_inspect": "allow" }
-
Ensure
@opencode-ai/pluginis available in the applicable OpenCode configuration directory:bun add @opencode-ai/plugin
-
Restart OpenCode.
- Replace the user's complete
opencode.jsonc. - Copy API keys or provider credentials from examples.
- change the user's primary model;
- register the plugin explicitly when it is already inside an auto-loaded
plugins/directory.
Attach an image and ask the primary agent to describe a visible detail.
A successful run should show a vision_inspect tool call. The final answer should still be generated by the primary model.
- Activates only when the primary model does not support image input.
- Sends images to the configured vision model in a temporary child session.
- Returns visual observations as a tool result.
- Does not copy the vision model's reasoning into the parent session.
- Deletes the temporary child session after inspection.
- A primary model with tool-calling support
- A vision-capable model available in OpenCode
- Local OpenCode plugin support
- Maximum image size: 15 MiB
- Vision timeout: 120 seconds
- Images are sent to the configured vision provider
- Special thanks to the community for their support and contributions: https://linux.do/
MIT