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
{{ message }}
Repository navigation
Missing tool description (undefined) on a plugin tool causes ALL sessions to crash with "Expected string, got undefined at [description]" #42026
When a local plugin registers tools via ctx.tool.transform → tools.add({...}), and one tool is missing its required description string field, it does NOT just make that one tool unusable — it breaks every session and every message, including a trivial "Reply with exactly: SMOKE_OK" that never touches the tool. The whole chat fails to get a reply at all.
Active plugins: local plugin at ~/.config/opencode/plugins/opencode-mobile-use/index.ts
Reproduction
Create a local plugin registering several tools via ctx.tool.transform, all with proper name + description + input + execute, except one tool that omits description entirely.
Run any session: opencode2 run "Reply with exactly: SMOKE_OK".
Result: the command exits non-zero with:
Error: Expected string, got undefined
at ["description"]
In the daemon log the stack is:
Failed to drain Session Error: Expected string, got undefined at ["description"]
at SchemaParser.js:142:15
at ../ai/src/schema/messages.ts:244:88
at ../ai/src/llm.ts:59:19
at SessionModelRequest.prepare (../core/src/session/model-request.ts:218:27)
at SessionRunner.callModel ...
at SessionRunner.drain ...
Actual Behavior
Every session dies during SessionModelRequest.prepare — the request is built from the full message + entire tool catalog, and a single tool with description: undefined fails schema validation for the whole thing. The model is never even called. No reply is ever produced. The failure is silent from the user's perspective in the TUI — messages just stop getting answers.
Ideally opencode should validate plugin tool definitions at load/register time and emit a clear, actionable error naming the offending tool (phone_type) rather than an opaque Expected string, got undefined at ["description"] deep in schema parsing that gives zero indication which tool or field is broken.
Additional Context
The bug is trigger-happy on config edits: a developer editing a plugin's description strings can silently delete one field and take down their whole opencode install.
This took a long debugging session to pin down because the stack trace gives no tool name, and the symptom (all sessions failing to reply) looks like a model/provider/auth/version problem rather than a missing field on one tool.
Error message clarity is the main ask: name the offending field/tool. A missing required field on a tool should be isolated, not fatal to the entire session.
This issue might be a duplicate of existing issues. Please check:
fix(core): isolate invalid plugin tools during reload #35963: Covers the same root cause — one broken/invalid plugin tool prevents all sessions from materializing their tool catalog, with the same desired fix (isolate invalid tools at registration time, not at session execution time)
If your issue is specifically about the missing description field triggering schema validation failure in SessionModelRequest.prepare (rather than the opaque tool WeakMap identity problem in #35963), it may warrant its own fix, but the underlying ask — isolate bad tools from crashing all sessions — is already tracked.
Addressed by #42117. Model-facing tool definitions are now schema-validated before the Location registry mutates; malformed registrations return a Tool.RegistrationError naming the offending tool and schema failure. Registration batches remain atomic, so one missing description cannot poison the catalog or break later Session request preparation. Focused registry regressions cover the failure path. Closing as resolved on the v2 branch.
Activity
github-actions commentedon Aug 12, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is specifically about the missing
descriptionfield triggering schema validation failure inSessionModelRequest.prepare(rather than the opaque toolWeakMapidentity problem in #35963), it may warrant its own fix, but the underlying ask — isolate bad tools from crashing all sessions — is already tracked.opencode-agent commentedon Aug 13, 2026
Addressed by #42117. Model-facing tool definitions are now schema-validated before the Location registry mutates; malformed registrations return a
Tool.RegistrationErrornaming the offending tool and schema failure. Registration batches remain atomic, so one missing description cannot poison the catalog or break later Session request preparation. Focused registry regressions cover the failure path. Closing as resolved on the v2 branch.