anomalyco / anomalyco/opencode
Detect and reject placeholder filesystem paths before tool execution
@jlongster is already working on this.
Since Jul 26, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Summary
When using local models (Qwen3, DeepSeek, etc.), the model may generate placeholder filesystem paths such as:
/absolute/path/to/file.md
instead of a valid workspace-relative path.
Currently OpenCode interprets this as a real absolute path and asks the user for permission to access an external directory.
Reproduction
Workspace:
~/Documents/mind
Prompt:
create file.md with no content
Model output:
Write("/absolute/path/to/file.md")
OpenCode requests permission to access:
/absolute/path/to/
instead of recognizing this as a placeholder.
Expected behavior
OpenCode should detect common placeholder paths before executing filesystem tools.
Examples:
/absolute/path/to/*
/path/to/*
/your/path/*
/tmp/example/*
These should be treated as invalid placeholder values instead of real filesystem locations.
Possible response:
The model generated a placeholder path. Please provide a valid workspace-relative path.
Why this matters
This is not specific to Qwen.
Many local models occasionally emit placeholder values copied from training examples.
Detecting these placeholders would make filesystem tools much more robust regardless of the model being used.
Plugins
None
OpenCode version
1.18.5
Steps to reproduce
No response
Screenshot and/or share link
Steps to reproduce
- Start OpenCode inside a project workspace.
cd ~/Documents/mind
opencode
- Use the following model:
qwen3:latest (Ollama)
- Ask the assistant:
create file.md with no content
- Observe that the model invokes the filesystem tool with the following path:
/absolute/path/to/file.md
- OpenCode requests permission to access an external directory:
Access external directory
/absolute/path/to/
Operating System
Ubuntu 25.10
Terminal
Christian Hergert 49.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.