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
Getting stuck at 'Running commands' > Shell > undefined #5662
The issue is not directly related to the PTY shell detection in the desktop package. Instead, this appears to be related to how the bash tool renders in the UI when props.input.description is undefined.
Looking at the UI component in packages/ui/src/components/message-part.tsx lines 426-431:
The subtitle is set to props.input.description. When the LLM calls the bash tool without providing the description parameter, this value is undefined.
In basic-tool.tsx line 51-60, there's a <Show when={trigger().subtitle}> check that should hide it when falsy. However, if the description is the literal string"undefined" (which can happen during JSON serialization/deserialization), it would still display.
Potential Causes
The model is sending the literal string "undefined" as the description parameter instead of omitting it or sending null.
JSON serialization issue: When tool inputs are serialized/deserialized, undefined values might be converted to the string "undefined".
Windows-specific issue: On Windows with cmder, there may be something unusual about how the environment or tool inputs are being processed.
Shell Detection on Windows
The shell detection in packages/opencode/src/shell/shell.ts is actually robust and should never return undefined:
functionfallback(){if(process.platform==="win32"){if(Flag.OPENCODE_GIT_BASH_PATH)returnFlag.OPENCODE_GIT_BASH_PATHconstgit=Bun.which("git")if(git){constbash=path.join(git,"..","..","bin","bash.exe")if(Bun.file(bash).size)returnbash// ⚠️ Potential issue here}returnprocess.env.COMSPEC||"cmd.exe"// Always has fallback}// ...}
One edge case: Bun.file(bash).size is async but is being used synchronously. This could return a Promise object that's truthy but not a valid shell path. However, this wouldn't produce the string "undefined".
Recommendation
The issue is most likely that the bash tool's description parameter is being displayed as the literal string "undefined". The fix would be to add defensive handling in the UI:
subtitle: props.input.description||undefined,
This ensures that falsy strings like empty string or the string "undefined" aren't displayed.
I took the desktop app for a spin and ran into this error as well. Agent runs shell command that presents undefined then just continues to spin indefinitely.
I'm trying to replicate it, but I think it could be from continuing a session that was first started via cli, then opening it in desktop. Off 1.0.193, running a session from start on desktop, I haven't been able to make it fail.
I'm trying to replicate it, but I think it could be from continuing a session that was first started via cli, then opening it in desktop. Off 1.0.193, running a session from start on desktop, I haven't been able to make it fail.
Spoke too soon. Unfortunately, I can't share this particular session.
I have the same Problem, it was a newly fresh created session in open code.
The problem accrued after the first update today to V1.0.195 (MacOS).
Not my biggest want but it is no big deal for me to share the session with a developer.
It is strange, even when I make a new session inside the project the error persists.
Only when I make a new project it behaves normal again. @rekram1-node how can I send you the Session Link? The Discord Link in your bio is expired.
Or should I send to @adamdotdevin since he is assigned now?
I am kinda stuck with my work, I already got used to OpenCode with in just a day, that I rather wait until it is fixed.
But I can't also wait weeks or indefinitely :P Thanks by the way for all contributors initiators, for every invested second!
Activity
github-actions commentedon Dec 17, 2025
This issue might be a duplicate of existing issues. Please check:
opencodehang. #3273: MCP client failing makes opencode hangFeel free to ignore if none of these address your specific case.
rekram1-node commentedon Dec 17, 2025
/oc any idea what could be causing this? look at what shell the packages/desktop uses for the pty ajd figure out what could result in this
opencode-agent commentedon Dec 17, 2025
Now I have a complete picture. Let me summarize the findings:
Analysis: "Running commands > Shell > undefined" Issue
Root Cause
The issue is not directly related to the PTY shell detection in the desktop package. Instead, this appears to be related to how the bash tool renders in the UI when
props.input.descriptionisundefined.Looking at the UI component in
packages/ui/src/components/message-part.tsxlines 426-431:The
subtitleis set toprops.input.description. When the LLM calls the bash tool without providing thedescriptionparameter, this value isundefined.In
basic-tool.tsxline 51-60, there's a<Show when={trigger().subtitle}>check that should hide it when falsy. However, if the description is the literal string"undefined"(which can happen during JSON serialization/deserialization), it would still display.Potential Causes
The model is sending the literal string
"undefined"as the description parameter instead of omitting it or sendingnull.JSON serialization issue: When tool inputs are serialized/deserialized,
undefinedvalues might be converted to the string"undefined".Windows-specific issue: On Windows with cmder, there may be something unusual about how the environment or tool inputs are being processed.
Shell Detection on Windows
The shell detection in
packages/opencode/src/shell/shell.tsis actually robust and should never returnundefined:One edge case:
Bun.file(bash).sizeis async but is being used synchronously. This could return aPromiseobject that's truthy but not a valid shell path. However, this wouldn't produce the string "undefined".Recommendation
The issue is most likely that the bash tool's
descriptionparameter is being displayed as the literal string "undefined". The fix would be to add defensive handling in the UI:This ensures that falsy strings like empty string or the string "undefined" aren't displayed.
opencode session | github run
badrul commentedon Dec 17, 2025
running with --print-logs, i get these:
ERROR 2025-12-17T02:09:45 +151ms service=acp-command promise={} reason=NotFoundError Unhandled rejection
ERROR 2025-12-17T02:09:45 +1ms service=default e=NotFoundError rejection
INFO 2025-12-17T02:09:46 +461ms service=bus type=session.updated publishing
INFO 2025-12-17T02:09:46 +2ms service=bus type=session.diff publishing
ERROR 2025-12-17T02:09:47 +1013ms service=acp-command promise={} reason=NotFoundError Unhandled rejection
ERROR 2025-12-17T02:09:47 +0ms service=default e=NotFoundError rejection
INFO 2025-12-17T02:09:53 +6233ms service=session.summary title=Checking Current Status title
INFO 2025-12-17T02:09:53 +1ms service=bus type=message.updated publishing
ERROR 2025-12-17T02:09:54 +1005ms service=acp-command promise={} reason=NotFoundError Unhandled rejection
ERROR 2025-12-17T02:09:54 +0ms service=default e=NotFoundError rejection
INFO 2025-12-17T02:10:02 +8317ms service=snapshot hash=3745f8b408349c5a1ab621d58ef9f5f0642b16c1
cwd=C:[project path] git=C:[user path].local\share\opencode\snapshot\c5b6b9820d4608b7746befe7c7b05d559b3e8f05 tracking
INFO 2025-12-17T02:10:02 +3ms service=bus type=message.part.updated publishing
INFO 2025-12-17T02:10:02 +5ms service=bus type=message.part.updated publishing
ERROR 2025-12-17T02:10:03 +1002ms service=acp-command promise={} reason=NotFoundError Unhandled rejection
ERROR 2025-12-17T02:10:03 +0ms service=default e=NotFoundError rejection
INFO 2025-12-17T02:10:04 +978ms service=bus type=message.part.updated publishing
INFO 2025-12-17T02:10:05 +331ms service=bus type=message.part.updated publishing
INFO 2025-12-17T02:10:05 +8ms service=bus type=message.part.updated publishing
INFO 2025-12-17T02:10:05 +29ms service=permission sessionID=ses_4d84b8842ffedJ5Fi5cf25T3wS messageID=msg_b2a120e73002idlMUkP93KoBoH toolCallID=call_d4906847513741d9b6c3011e pattern=["git status *"] asking
INFO 2025-12-17T02:10:05 +1ms service=bus type=permission.updated publishing
ERROR 2025-12-17T02:10:05 +646ms service=acp-command promise={} reason=NotFoundError Unhandled rejection
ERROR 2025-12-17T02:10:05 +1ms service=default e=NotFoundError rejection
INFO 2025-12-17T02:10:05 +7ms service=bus type=message.part.updated publishing
INFO 2025-12-17T02:10:05 +2ms service=bus type=message.part.updated publishing
ERROR 2025-12-17T02:10:06 +1005ms service=acp-command promise={} reason=NotFoundError Unhandled rejection
ERROR 2025-12-17T02:10:06 +1ms service=default e=NotFoundError rejection
rekram1-node commentedon Dec 17, 2025
hm need to figure out that not found error looks like cause
wolfie82 commentedon Dec 23, 2025
I took the desktop app for a spin and ran into this error as well. Agent runs shell command that presents
undefinedthen just continues to spin indefinitely.rekram1-node commentedon Dec 23, 2025
can u share a session w me?
wolfie82 commentedon Dec 23, 2025
I'm trying to replicate it, but I think it could be from continuing a session that was first started via cli, then opening it in desktop. Off 1.0.193, running a session from start on desktop, I haven't been able to make it fail.
wolfie82 commentedon Dec 23, 2025
Spoke too soon. Unfortunately, I can't share this particular session.
aldaw commentedon Dec 24, 2025
I have the same Problem, it was a newly fresh created session in open code.
The problem accrued after the first update today to V1.0.195 (MacOS).
Not my biggest want but it is no big deal for me to share the session with a developer.
aldaw commentedon Dec 25, 2025
It is strange, even when I make a new session inside the project the error persists.
Only when I make a new project it behaves normal again.
@rekram1-node how can I send you the Session Link? The Discord Link in your bio is expired.
Or should I send to @adamdotdevin since he is assigned now?
aldaw commentedon Dec 25, 2025
Anyone encountered any kind of work around?
I am kinda stuck with my work, I already got used to OpenCode with in just a day, that I rather wait until it is fixed.
But I can't also wait weeks or indefinitely :P Thanks by the way for all contributors initiators, for every invested second!
github-actions commentedon Mar 25, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.
johnsonsleo commentedon Apr 4, 2026
same issue