From 93bf9e78b7b5a6098494d83e0ed6ab84feb26998 Mon Sep 17 00:00:00 2001 From: rareboe Date: Wed, 26 Aug 2026 10:35:07 +0900 Subject: [PATCH] fix(tool): simplify the glob path parameter description 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: #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. --- packages/opencode/src/tool/glob.ts | 3 ++- .../opencode/test/tool/__snapshots__/parameters.test.ts.snap | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/opencode/src/tool/glob.ts b/packages/opencode/src/tool/glob.ts index 40d3a27d3cba..e53610501328 100644 --- a/packages/opencode/src/tool/glob.ts +++ b/packages/opencode/src/tool/glob.ts @@ -10,7 +10,8 @@ import * as Tool from "./tool" export const Parameters = Schema.Struct({ pattern: Schema.String.annotate({ description: "The glob pattern to match files against" }), path: Schema.optional(Schema.String).annotate({ - description: `The directory to search in. If not specified, the current working directory will be used. IMPORTANT: Omit this field to use the default directory. DO NOT enter "undefined" or "null" - simply omit it for the default behavior. Must be a valid directory path if provided.`, + description: + "The directory to search in. If omitted, the current working directory is used. Must be a valid directory path if provided.", }), }) diff --git a/packages/opencode/test/tool/__snapshots__/parameters.test.ts.snap b/packages/opencode/test/tool/__snapshots__/parameters.test.ts.snap index 51ff867ea44d..e25912c7b6ae 100644 --- a/packages/opencode/test/tool/__snapshots__/parameters.test.ts.snap +++ b/packages/opencode/test/tool/__snapshots__/parameters.test.ts.snap @@ -78,7 +78,7 @@ exports[`tool parameters JSON Schema (wire shape) glob 1`] = ` "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "path": { - "description": "The directory to search in. If not specified, the current working directory will be used. IMPORTANT: Omit this field to use the default directory. DO NOT enter "undefined" or "null" - simply omit it for the default behavior. Must be a valid directory path if provided.", + "description": "The directory to search in. If omitted, the current working directory is used. Must be a valid directory path if provided.", "type": "string", }, "pattern": {