Repository navigation
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
How to reproduce?
gemini-3-pro-preview in opencode will sometimes use grep and glob tools, but compared to other models, it tends to avoid them in many circumstances.
For example:
- In a checkout of the opencode repo at commit
27b45d070d927c6fd423f9eb0f8ad6a3a612336f. - runn:
opencode run --model google/gemini-3-pro-preview "Where is the code testing global skills?" - Most of the time you'll see a call to
bash (find . -name "*skill*", grep -E "test|spec"),bash (find . -name "*skill*" -o -name "*test*", grep -v "node_modules", head -n), or something along these lines.
Possible root cause
I tried tweaking bash.txt with more explicit guidance and tool equivalences, which appeared to improve the issue in some cases, but it still had a strong avoidance of grep and glob.
Then I reviewed gemini.txt and noticed there's ambiguous guidance that could be interpreted as if grep and glob didn't support relative paths (I think they do?). So I tried to make that less ambiguous with this:
diff --git a/packages/opencode/src/session/prompt/gemini.txt b/packages/opencode/src/session/prompt/gemini.txt
index 87fe422bc..b607d45b9 100644
--- a/packages/opencode/src/session/prompt/gemini.txt
+++ b/packages/opencode/src/session/prompt/gemini.txt
@@ -50,7 +50,7 @@ When requested to perform tasks like fixing bugs, adding features, refactoring,
- **Security First:** Always apply security best practices. Never introduce code that exposes, logs, or commits secrets, API keys, or other sensitive information.
## Tool Usage
-- **File Paths:** Always use absolute paths when referring to files with tools like 'read' or 'write'. Relative paths are not supported. You must provide an absolute path.
+- **Absolute File Paths:** In tools like `read`, `write`, or `apply_patch`, always use absolute paths when referring to files. Relative paths are not supported in these tools. You must provide an absolute path. However, tools `grep` and `glob` do support relative paths.
- **Parallelism:** Execute multiple independent tool calls in parallel when feasible (i.e. searching the codebase).
- **Command Execution:** Use the 'bash' tool for running shell commands, remembering the safety rule to explain modifying commands first.
- **Background Processes:** Use background processes (via \`&\`) for commands that are unlikely to stop on their own, e.g. \`node server.js &\`. If unsure, ask the user.This seems to fix the issue, at least as far as I tested with several cases.
Plugins
None.
OpenCode version
Tested with 1.1.34 and also with commit 9513ae23c3d6739fe17a3b9e758739696fb93d7c.
Steps to reproduce
See above.
Screenshot and/or share link
No response
Operating System
Linux
Terminal
Ghostty
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
github-actions commentedon Jan 24, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
github-actions commentedon Mar 27, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.