fix(tool): simplify the glob path parameter description - #45120
Open
rareboe wants to merge 1 commit into
Open
Conversation
The glob `path` description was the only tool parameter in the repo carrying an `IMPORTANT: ... DO NOT enter "undefined" or "null"` block. Grammar-constrained local backends can destabilise on it: anomalyco#44489 reports Qwen3-Coder through llama.cpp emitting repeated text, malformed tool calls and degenerate `?` arguments for glob, all of which stop once the description is simplified. Match the wording already used by the neighbouring grep tool and by the v2 glob tool in packages/core. The "must be a valid directory path" hint is kept because the tool really does throw when the path is not a directory.
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.
Issue for this PR
Closes #44489
Type of change
What does this PR do?
Simplifies the
pathparameter description on theglobtool.The old string was:
packages/opencode/src/tool/glob.tswas the only place in the repo carrying thatIMPORTANT: ... DO NOT enter "undefined" or "null"block. The neighbouringgreptool already uses"The directory to search in. Defaults to the current working directory.", and the v2 glob tool inpackages/core/src/tool/glob.tsuses"Relative directory to search. Defaults to the active Location."— so this was the outlier, not the house style.It also has a practical cost. #44489 reports Qwen3-Coder via llama.cpp producing repeated text, malformed tool-call-like output, and degenerate arguments full of
?forglobspecifically, in one case aborting the request withUnexpected empty grammar stack after accepting piece: ?. Rewriting only this description via thetool.definitionhook made the same model call the tool correctly, with no schema change.The semantics are unchanged. I kept the "must be a valid directory path if provided" clause because it is load-bearing — the tool throws
glob path must be a directorywhen it isn't — and only dropped the negative instructions.How did you verify your code works?
The description is pinned by the wire-shape snapshot, which localises the change precisely — running the suite before updating it showed exactly one snapshot diff, the glob
pathdescription, and nothing else:Snapshot updated, then:
I don't have the llama.cpp/Qwen3-Coder setup to reproduce the decoding failure itself, so the behavioural claim there is the reporter's, not mine. What this PR verifies is that the string change is isolated to the glob schema and breaks nothing else.
Screenshots / recordings
Not a UI change.
Checklist