The open source coding agent.
TypeScript
fix: fix wrong tool references `LS` and `Agent` (#2466)
Kenn Costalesdf61aa801b97
diff --git a/packages/opencode/src/tool/bash.txt b/packages/opencode/src/tool/bash.txtindex 342073b9bb2..67c54677fce 100644--- a/packages/opencode/src/tool/bash.txt+++ b/packages/opencode/src/tool/bash.txt@@ -3,8 +3,8 @@ Executes a given bash command in a persistent shell session with optional timeouBefore executing the command, please follow these steps:1. Directory Verification:- - If the command will create new directories or files, first use the LS tool to verify the parent directory exists and is the correct location- - For example, before running "mkdir foo/bar", first use LS to check that "foo" exists and is the intended parent directory+ - If the command will create new directories or files, first use the List tool to verify the parent directory exists and is the correct location+ - For example, before running "mkdir foo/bar", first use List to check that "foo" exists and is the intended parent directory2. Command Execution:- Always quote file paths that contain spaces with double quotes (e.g., cd "path with spaces/file.txt")@@ -21,7 +21,7 @@ Usage notes:- You can specify an optional timeout in milliseconds (up to 600000ms / 10 minutes). If not specified, commands will timeout after 120000ms (2 minutes).- It is very helpful if you write a clear, concise description of what this command does in 5-10 words.- If the output exceeds 30000 characters, output will be truncated before being returned to you.- - VERY IMPORTANT: You MUST avoid using search commands like `find` and `grep`. Instead use Grep, Glob, or Task to search. You MUST avoid read tools like `cat`, `head`, `tail`, and `ls`, and use Read and LS to read files.+ - VERY IMPORTANT: You MUST avoid using search commands like `find` and `grep`. Instead use Grep, Glob, or Task to search. You MUST avoid read tools like `cat`, `head`, `tail`, and `ls`, and use Read and List to read files.- If you _still_ need to run `grep`, STOP. ALWAYS USE ripgrep at `rg` (or /usr/bin/rg) first, which all opencode users have pre-installed.- When issuing multiple commands, use the ';' or '&&' operator to separate them. DO NOT use newlines (newlines are ok in quoted strings).- Try to maintain your current working directory throughout the session by using absolute paths and avoiding usage of `cd`. You may use `cd` if the User explicitly requests it.diff --git a/packages/opencode/src/tool/glob.txt b/packages/opencode/src/tool/glob.txtindex 3873a476103..2cf16a05fa5 100644--- a/packages/opencode/src/tool/glob.txt+++ b/packages/opencode/src/tool/glob.txt@@ -2,5 +2,5 @@- Supports glob patterns like "**/*.js" or "src/**/*.ts"- Returns matching file paths sorted by modification time- Use this tool when you need to find files by name patterns-- When you are doing an open ended search that may require multiple rounds of globbing and grepping, use the Agent tool instead+- When you are doing an open ended search that may require multiple rounds of globbing and grepping, use the Task tool instead- You have the capability to call multiple tools in a single response. It is always better to speculatively perform multiple searches as a batch that are potentially useful.diff --git a/packages/opencode/src/tool/grep.txt b/packages/opencode/src/tool/grep.txtindex 3caef001a2e..d964a3d1f41 100644--- a/packages/opencode/src/tool/grep.txt+++ b/packages/opencode/src/tool/grep.txt@@ -5,4 +5,4 @@- Returns file paths with at least one match sorted by modification time- Use this tool when you need to find files containing specific patterns- If you need to identify/count the number of matches within files, use the Bash tool with `rg` (ripgrep) directly. Do NOT use `grep`.-- When you are doing an open ended search that may require multiple rounds of globbing and grepping, use the Agent tool instead+- When you are doing an open ended search that may require multiple rounds of globbing and grepping, use the Task tool insteaddiff --git a/packages/opencode/src/tool/task.txt b/packages/opencode/src/tool/task.txtindex 27e7bc5de7b..2be3819f0e1 100644--- a/packages/opencode/src/tool/task.txt+++ b/packages/opencode/src/tool/task.txt@@ -5,13 +5,13 @@ Available agent types and the tools they have access to:When using the Task tool, you must specify a subagent_type parameter to select which agent type to use.-When to use the Agent tool:-- When you are instructed to execute custom slash commands. Use the Agent tool with the slash command invocation as the entire prompt. The slash command can take arguments. For example: Task(description="Check the file", prompt="/check-file path/to/file.py")+When to use the Task tool:+- When you are instructed to execute custom slash commands. Use the Task tool with the slash command invocation as the entire prompt. The slash command can take arguments. For example: Task(description="Check the file", prompt="/check-file path/to/file.py")-When NOT to use the Agent tool:-- If you want to read a specific file path, use the Read or Glob tool instead of the Agent tool, to find the match more quickly+When NOT to use the Task tool:+- If you want to read a specific file path, use the Read or Glob tool instead of the Task tool, to find the match more quickly- If you are searching for a specific class definition like "class Foo", use the Glob tool instead, to find the match more quickly-- If you are searching for code within a specific file or set of 2-3 files, use the Read tool instead of the Agent tool, to find the match more quickly+- If you are searching for code within a specific file or set of 2-3 files, use the Read tool instead of the Task tool, to find the match more quickly- Other tasks that are not related to the agent descriptions above