Image hook plugin for oh-my-openagent.
Automatically saves pasted images to disk and instructs Sisyphus to use look_at for visual analysis.
- O(1) deduplication: Hash-based cache prevents duplicate saves
- Lazy initialization: Minimal overhead until first image paste
- Timer-based cleanup: Non-blocking background cleanup every 10 minutes
- Built-in instructions: No manual prompt configuration needed
- Handles edge cases: Non-data-url images preserved, concurrent saves safe
git clone https://github.com/Jiajun0413/omo-watcher.git
cd omo-watcher
bun install
bun run buildIn ~/.config/opencode/oh-my-openagent.jsonc:
That's it. The plugin handles everything automatically.
Use absolute paths only. Relative paths may not resolve correctly.
opencodeRemove the omo-watcher path from the plugin array.
Clean up saved images:
rm -rf .opencode/images/Pass options as a tuple in the plugin array:
{
"plugin": [
"oh-my-opencode-slim",
["/path/to/omo-watcher", { "maxAgeMs": 7200000, "cleanupIntervalMs": 300000 }]
]
}| Option | Default | Description |
|---|---|---|
maxAgeMs |
3600000 (1h) | Max age before cleanup |
cleanupIntervalMs |
600000 (10min) | Cleanup interval |
User pastes image → plugin saves to .opencode/images/<name>-<hash>.png
→ strips binary from message
→ inserts instruction text
→ Sisyphus calls look_at(file_path, goal)
→ multimodal-looker reads & analyzes image
Key optimizations vs omos original:
- Hash-based O(1) dedup (no counter retry)
- Lazy init (mkdir once per workspace)
- Timer-based cleanup (non-blocking)
- Pre-compiled regex (no repeated compilation)
- Flat directory structure (no session subdirs)
MIT
{ "plugin": [ "oh-my-opencode-slim", "/absolute/path/to/omo-watcher" ] }