Repository navigation
fix(core): keep shell commands working after their output directory is removed - #64889
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
The fix works. I reproduced #64752 on the base with opencode-drive and the simulated model: deleting <data>/opencode/shell while the server runs makes the next ls fail with failed to open output file … No such file or directory. With this PR the same ls runs and returns its listing. The two new tests fail on the base and pass here. The nearby shell tests pass, and typecheck:tsc passes for packages/core.
Public API: unchanged.
One side effect, for the record: since the mkdir no longer runs when the service is built, a blocked path (as in #59817) no longer breaks setting up the whole project location. Only shell commands fail, with an AppProcessError. No concerns.
joe-ieta
pushed a commit
to joe-ieta/OpenCode.My
that referenced
this pull request
Nov 19, 2026
…s removed (anomalyco#64889) (cherry picked from commit c740f6d)
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Issue for this PR
Closes #64752
Type of change
What does this PR do?
The shell service created
<data>/shell/<project-id>/once, when the Location's shell layer was built. If that directory disappeared while the Location stayed open, every later command failed withfailed to open output file ... No such file or directoryuntil a restart (the daemon refuses to create the pipe; the spawner's write stream fails).Shell.createnow ensures the directory exists before each command, on both the daemon and spawner paths. If it cannot be created (for example a file sits at that path), the command fails with anAppProcessErrorbefore anything runs. No flag: this is a fix.Same approach as @r266-tech's patch in the issue thread.
How did you verify your code works?
packages/core/test/shell-daemon.test.tsremove the shell directory between two commands, for the daemon path and the spawner fallback. Both fail ondevand pass here (--rerun-each 10).shell-daemon,shell-retention,shell-cleanup,shell-restart,session-shell,tool-shell) still pass. The twotool-shell"conditional substitutions" failures happen ondevtoo.bun run checkpasses.Checklist
Added by the opencode bot (AI-generated).
Related: #59817, #62763