You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
agents will create empty folders it didn't mean to when using mkdir -p {src,test,...} #3340
When some models want to create many folders all at once they'll use the syntax:
mkdir -p src/{folder1,folder2,folder3}`
and it will literally create a folder src/{folder1,folder2,folder3}
OpenCode version
0.15.11
Steps to reproduce
as an agent (I've been using big pickle and glm-4.6) to scaffold a module that will require it to create many directories, like trying to consolidate or move several modules
The a/{x,y,z} syntax is called cartesian product and it's not supported by every shell. Since we use the shell from $SHELL to run the commands, the variable probably points to a lesser-featured shell like dash.
@riatzukiza Can you run echo $SHELL in the terminal where you run opencode, and tell me what it prints?
Actually, I was wrong here (when writing that comment I was thinking about the ! command invocation). It does in fact use /bin/sh, which almost certainly lacks the cartesian product functionality. This issue suggests an implementation which would actually make opencode behave in the way I described in my previous comment: #3479
@rekram1-node Perhaps we can consider implementing the suggestion from #3479, or at least indicate in the system prompt what shell it's dealing with, so it knows to avoid certain capabilities.
I'd like to work on this. The root cause is that Shell.acceptable() passes through POSIX-only shells (sh/dash) which don't support brace expansion. Added them to the blacklist so the fallback picks bash instead.
Activity
rekram1-node commentedon Oct 22, 2025
Hm never encountered this
veracioux commentedon Oct 25, 2025
The
a/{x,y,z}syntax is called cartesian product and it's not supported by every shell. Since we use the shell from$SHELLto run the commands, the variable probably points to a lesser-featured shell likedash.@riatzukiza Can you run
echo $SHELLin the terminal where you run opencode, and tell me what it prints?veracioux commentedon Oct 27, 2025
Actually, I was wrong here (when writing that comment I was thinking about the
!command invocation). It does in fact use/bin/sh, which almost certainly lacks the cartesian product functionality. This issue suggests an implementation which would actually make opencode behave in the way I described in my previous comment: #3479@rekram1-node Perhaps we can consider implementing the suggestion from #3479, or at least indicate in the system prompt what shell it's dealing with, so it knows to avoid certain capabilities.
rekram1-node commentedon Oct 27, 2025
I think implementing suggestion > indicate in system prompt.
We should make it bash if possible but need to handle windows otherwise
Don't like all unix systems support bash basically? i guess it doesnt hurt to add a check
veracioux commentedon Oct 27, 2025
I think they do, but we might also want to support containerized use cases like alpine, so a check is a good idea.
Br1an67 commentedon Mar 1, 2026
I'd like to work on this. The root cause is that
Shell.acceptable()passes through POSIX-only shells (sh/dash) which don't support brace expansion. Added them to the blacklist so the fallback picks bash instead.PR: #15610
github-actions commentedon May 1, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.