Problem
When OpenCode shows inline image previews in the chat, it displays just the filename (e.g., filename.png) without any surrounding trigger words like "analyze", "screenshot", "describe", or "look at".
Skills like vision-analysis are configured to auto-activate when the message contains these trigger words. However, since inline images only show the filename without any such context words, the skill never auto-activates.
Without trigger words: Agent doesn't know what to do → says "API requires valid key" and gives up.
With trigger words adjacent to image: Skill auto-activates → agent uses correct tool → works.
Expected Behavior
Skills with text trigger patterns should be able to auto-activate even when the image is shown inline, because the skill's activation depends on text adjacent to the image in the message.
Example
User sends: "[inline image: screenshot.png]"
OpenCode displays: Just screenshot.png with no trigger words
Agent receives: No trigger words in the text portion → vision-analysis skill doesn't activate
Proposed Solution
The inline image rendering should either:
- Include trigger words in the text that gets sent to the agent (e.g., "look at this image: screenshot.png")
- Extract trigger words from the filename itself (e.g., "Screenshot" from "Screenshot 2026-04-08 at 2.54.51 pm.png" normalizes to "screenshot" which IS a trigger word)
- Or ensure that the skill activation logic considers image attachments as implicit triggers
This is an OpenCode-side limitation, not a skill configuration issue.
Investigation Summary
File to change: packages/opencode/src/session/message-v2.ts lines 654-669
Currently when stripMedia is true, it adds [Attached ${mime}: ${filename}] text, but for actual image input to the LLM, no trigger text is added before the file part.
The fix would add a text part with appropriate trigger words (extracted from filename or a fallback) before the file part, so skills like vision-analysis can auto-activate.
Verification
Problem
When OpenCode shows inline image previews in the chat, it displays just the filename (e.g.,
filename.png) without any surrounding trigger words like "analyze", "screenshot", "describe", or "look at".Skills like
vision-analysisare configured to auto-activate when the message contains these trigger words. However, since inline images only show the filename without any such context words, the skill never auto-activates.Without trigger words: Agent doesn't know what to do → says "API requires valid key" and gives up.
With trigger words adjacent to image: Skill auto-activates → agent uses correct tool → works.
Expected Behavior
Skills with text trigger patterns should be able to auto-activate even when the image is shown inline, because the skill's activation depends on text adjacent to the image in the message.
Example
User sends: "[inline image: screenshot.png]"
OpenCode displays: Just
screenshot.pngwith no trigger wordsAgent receives: No trigger words in the text portion → vision-analysis skill doesn't activate
Proposed Solution
The inline image rendering should either:
This is an OpenCode-side limitation, not a skill configuration issue.
Investigation Summary
File to change:
packages/opencode/src/session/message-v2.tslines 654-669Currently when
stripMediais true, it adds[Attached ${mime}: ${filename}]text, but for actual image input to the LLM, no trigger text is added before the file part.The fix would add a text part with appropriate trigger words (extracted from filename or a fallback) before the file part, so skills like vision-analysis can auto-activate.
Verification