You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several robustness gaps in the plugin system and session prompt paths cause crashes, silent errors, or unexpected behavior when building plugins:
Agent/command resolution crashes with TypeError on invalid names — Agent.get() and Command.get() return undefined for unknown names, but callers at 5 sites in session/prompt.ts dereference without null checks. This produces an untyped TypeError: Cannot read properties of undefined instead of a helpful typed error.
prompt_async route silently drops errors — The /:sessionID/prompt_async route calls SessionPrompt.prompt() without .catch(), so failures in detached prompts are silently lost with no logging and no Session.Event.Error published.
Plugin config hook errors crash entire bootstrap — A single plugin's config hook throwing prevents all subsequent hooks from running. There is no error isolation between hooks in Plugin.init().
command.execute.before hook receives merged parts — The hook fires after template parts are already merged with input.parts, making it difficult for plugins to cleanly replace or transform template content without fragile index-based manipulation.
Plugins added by config hooks not loaded in same startup pass — When a plugin's config hook adds entries to config.plugin, the newly referenced plugins are not loaded because Plugin.state() has already resolved and is cached via Instance.state().
Plugins
N/A — affects core plugin infrastructure, not a specific plugin.
OpenCode version
v1.2.27 (current dev branch)
Steps to reproduce
Call SessionPrompt.prompt({ agent: "nonexistent" }) → crashes with TypeError: Cannot read properties of undefined (reading 'model') instead of a typed error
Trigger a model/agent mismatch error via the prompt_async route → caller sees no error; nothing logged, no Session.Event.Error published
Install a plugin whose config hook throws → all subsequent plugin config hooks are skipped entirely
Register a command.execute.before hook and inspect output.parts → contains both template parts and caller-provided input.parts already merged
In a plugin's config hook, push a new plugin path to config.plugin → the added plugin is not loaded during that startup pass
Screenshot and/or share link
No UI changes — these are internal plugin/session API issues.
Activity
github-actions commentedon Mar 19, 2026
This issue might be a duplicate of existing issues. Please check:
SessionPrompt.prompt()throws in thePOST /session/{id}/messageroute handler, the error is silently swallowed. #17536:SessionPrompt.prompt()errors silently swallowed in both/messageand/prompt_asyncroutes — directly overlaps with point 2 of this issueIf these cover the same root causes, it may be worth consolidating or cross-referencing.