Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

OpenCode Vision Fallback

A single-file OpenCode plugin that gives text-only agents access to image inspection through an isolated vision model.

Instructions for Agents

When asked to install this plugin:

  1. Copy vision-fallback.ts to one of these locations:

    ~/.config/opencode/plugins/vision-fallback.ts
    <project>/.opencode/plugins/vision-fallback.ts
    
  2. 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.

  3. Verify that the selected model supports image input.

    For custom models, add or merge:

    "modalities": {
      "input": ["text", "image"],
      "output": ["text"]
    }
  4. Add or merge the following permission without replacing the user's existing permission rules:

    "permission": {
      "vision_inspect": "allow"
    }
  5. Ensure @opencode-ai/plugin is available in the applicable OpenCode configuration directory:

    bun add @opencode-ai/plugin
  6. 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.

Verification

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.

Runtime Behavior

  • 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.

Requirements

  • A primary model with tool-calling support
  • A vision-capable model available in OpenCode
  • Local OpenCode plugin support

Limits

  • Maximum image size: 15 MiB
  • Vision timeout: 120 seconds
  • Images are sent to the configured vision provider

Community

  • Special thanks to the community for their support and contributions: https://linux.do/

License

MIT

About

Give text-only OpenCode agents vision without switching the primary model. A single-file plugin that delegates image inspection to an isolated multimodal session.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages