Description
The native Explore subagent sometimes uses Bash commands such as ls and rg for basic repository exploration even though the dedicated list, glob, grep, and read tools are available and allowed.
This creates unnecessary approval prompts for users who deliberately configure Bash as ask while allowing read-only tools.
Reproduction
Using OpenCode 1.17.20, configure:
{
"permission": {
"bash": {
"*": "ask"
},
"read": {
"*": "allow"
}
},
"agent": {
"explore": {
"model": "opencode-go/mimo-v2.5"
}
}
}
Delegate repository investigation to the native Explore agent. During ordinary file discovery and content search, Explore may invoke shell ls and rg, requiring manual approval.
Expected behavior
For ordinary read-only exploration, the native Explore agent should prefer:
list or glob instead of shell ls
grep instead of shell rg
read instead of shell readers
Bash should remain available for operations that genuinely require a shell, subject to the configured Bash permission. Users should not need to grant unrestricted Bash access merely to avoid prompts during file search.
Permission context
This is not caused by parent allow rules failing to propagate. deriveSubagentSessionPermission intentionally carries only parent deny and external_directory rules. The approval occurs because Explore chooses the Bash tool, which is independently subject to the configured Bash policy.
The native Explore definition already allows the dedicated read/search tools. Updating PROMPT_EXPLORE to explicitly prefer them and avoid Bash for listing, searching, and reading files would likely address the issue without weakening permissions.
Description
The native Explore subagent sometimes uses Bash commands such as
lsandrgfor basic repository exploration even though the dedicatedlist,glob,grep, andreadtools are available and allowed.This creates unnecessary approval prompts for users who deliberately configure Bash as
askwhile allowing read-only tools.Reproduction
Using OpenCode 1.17.20, configure:
{ "permission": { "bash": { "*": "ask" }, "read": { "*": "allow" } }, "agent": { "explore": { "model": "opencode-go/mimo-v2.5" } } }Delegate repository investigation to the native Explore agent. During ordinary file discovery and content search, Explore may invoke shell
lsandrg, requiring manual approval.Expected behavior
For ordinary read-only exploration, the native Explore agent should prefer:
listorglobinstead of shelllsgrepinstead of shellrgreadinstead of shell readersBash should remain available for operations that genuinely require a shell, subject to the configured Bash permission. Users should not need to grant unrestricted Bash access merely to avoid prompts during file search.
Permission context
This is not caused by parent allow rules failing to propagate.
deriveSubagentSessionPermissionintentionally carries only parent deny andexternal_directoryrules. The approval occurs because Explore chooses the Bash tool, which is independently subject to the configured Bash policy.The native Explore definition already allows the dedicated read/search tools. Updating
PROMPT_EXPLOREto explicitly prefer them and avoid Bash for listing, searching, and reading files would likely address the issue without weakening permissions.