fix(skill): replace broken skill-tools filtering with glob prefix matching - #2166
Merged
Conversation
- Replace dual edit/sed patches with apply_patch only in tool-script GPT reference - Add comprehensive PROMPT.md sections 6-10 for apply_patch workflow, git diffs, common failures, format examples, and structured verification flow - Enforce GPT: test via bash; Claude/Exec: use verify skill - Add test coverage for registry GPT script and structured verification prompt - Update all test expectations for unified tool-script reference - Clean up whitespace and tighten wording in bash tools and prompts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Skill tools filtering was using naive substring matching (
lower.includes(fragment)), causing broad matches:feishumatched all 70+ feishu tools (doc, bitable, board, calendar, sheet, task, drive, wiki, media, comment)fetchmatchedgithub_get_file_contentsbrowsermatchedbrowser_close,browser_console_messages,browser_hover, etc.Solution
Replaced with glob prefix matching:
*wildcard matches any sequence_) match tool name prefixestool-visibility.tsutilityChanges
packages/opencode/src/cli/cmd/tui/util/tool-visibility.ts- new utility withmatchesToolVisibility()andisToolVisibleForSkills()packages/opencode/src/cli/cmd/tui/routes/session/index.tsx- updated to use new utilitypackages/opencode/src/skill/index.ts- updatedSubagent()andInstall()to use new filteringpackages/opencode/test/tool/skill-search.test.ts- updated tests to use realistic tool namespackages/opencode/test/tool/skill.test.ts- updated tests and fixed handler scope issuespackages/opencode/test/cli/tui/tool-visibility.test.ts- new comprehensive testsTest Results