Repository navigation
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potentially related PR: Related PR:
This PR (42092) is a more targeted fix for a specific validation gap in plugin tools (missing descriptions), while #37309 handles broken custom workspace tools more broadly. They both aim to isolate malformed tool definitions from causing downstream failures. Otherwise, no exact duplicate PRs were found. The current PR appears to be addressing a specific edge case referenced in issue #42026. |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Refs #42026
Type of change
What does this PR do?
Skips plugin tool definitions whose
descriptionfield is not a string before they enter the tool registry.The file-scanned tool path already guarded malformed exports with
isPluginTool(...), but theplugin.list()path accepted every entry and forwarded it intofromPlugin(...). A plugin tool withdescription: undefinedcould then be surfaced to the model tool catalog and fail later during request/schema preparation.This keeps valid plugin tools and built-in tools available while isolating the malformed tool definition.
How did you verify your code works?
cd packages/opencode && bun test test/tool/registry.test.ts --test-name-pattern 'skips plugin tools with missing descriptions' --timeout 30000cd packages/opencode && bun test test/tool/registry.test.ts --timeout 60000cd packages/opencode && bun typecheckbun run lint packages/opencode/src/tool/registry.ts packages/opencode/test/tool/registry.test.tsgit diff --checkScreenshots / recordings
N/A; this is a registry validation fix.
Checklist