OpenCode plugin hot-reload races cause existing agents to throw Agent not found
remorses · ghdev · 2026-10-10
- A reproduced bug in OpenCode 2.0.19: when a plugin file changes mid-session (e.g., an agent runs tsc rebuilding the plugin entrypoint), the plugin watcher reloads plugins and config across all locations, rebuilding the agent catalog without config-defined agents.
- If the next step starts within the 50ms reload window, SessionContext.select (session/context.ts:129) throws AgentNotFoundError: Agent not found: "opus" — even though /.config/opencode/agents/opus.md exists and was never renamed or removed.
- The author pins the root cause to non-atomic reload (old config transform removed before the new one registers) and proposes that select should resolve existing agents or wait for reload to finish. Related issues: #53500, #52618.
More from coding & agent
- Claude cut a 2.6-hour video export to 20 minutes — but only after being told to rebuild the server — byhewar · 2026-10-23
- 3 flight-booking rules my AI agent checks that I'd never do by hand — Efistoffeles · 2026-10-23
- OpenJet claims Qwen3.8-27B coding runs 1.9x faster than llama.cpp on one RTX 3090 — JeremyCMorgan · 2026-10-23
- Building an autonomous SEO agent in Hermes with three skills: programmatic pages, Keywords Everywhere, DataForSEO — EXM7777 · 2026-10-23
- Building a sports betting AI agent with onchain execution and human approval by default: architecture and lessons — Dry-Comfortable-2678 · 2026-10-23
- How do you audit AI agent decisions in regulated workflows? A field survey — Ok_Way_1993 · 2026-10-23