Description
When grep searches a symlinked directory, its output contains the real target path instead of the requested symlink path.
This breaks subsequent tool calls when external_directory permissions allow the symlink path but not the underlying path. A read using the filename returned by grep is denied even though the original search was allowed.
Plugins
None
OpenCode version
Development version before 1e636f0f7
Steps to reproduce
- Create a file and symlinked directory:
mkdir -p /tmp/repro/real
printf 'CREATE TABLE business (id INTEGER);\n' > /tmp/repro/real/schema.sql
ln -s /tmp/repro/real /tmp/repro/db_schema
- Run grep with:
{
"path": "/tmp/repro/db_schema",
"include": "schema.sql",
"pattern": "CREATE TABLE .*business"
}
- Observe that grep returns:
/tmp/repro/real/schema.sql
Expected:
/tmp/repro/db_schema/schema.sql
Screenshot and/or share link
N/A
Operating System
Linux (Modal sandbox)
Terminal
N/A
Description
When grep searches a symlinked directory, its output contains the real target path instead of the requested symlink path.
This breaks subsequent tool calls when
external_directorypermissions allow the symlink path but not the underlying path. A read using the filename returned by grep is denied even though the original search was allowed.Plugins
None
OpenCode version
Development version before
1e636f0f7Steps to reproduce
{ "path": "/tmp/repro/db_schema", "include": "schema.sql", "pattern": "CREATE TABLE .*business" }Expected:
Screenshot and/or share link
N/A
Operating System
Linux (Modal sandbox)
Terminal
N/A