anomalyco / anomalyco/opencode

Detect and reject placeholder filesystem paths before tool execution

Open
#38,980 0 comments 0 reactions 1 assignee View on GitHub

@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

  1. Start OpenCode inside a project workspace.
cd ~/Documents/mind
opencode
  1. Use the following model:
qwen3:latest (Ollama)
  1. Ask the assistant:
create file.md with no content
  1. Observe that the model invokes the filesystem tool with the following path:
/absolute/path/to/file.md
  1. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.