GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(core): keep shell commands working after their output directory is removed by neriousy · Pull Request #64889 · anomalyco/opencode

Conversation

@neriousy

@neriousy neriousy commented Nov 19, 2026 •
edited by opencodejr Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Issue for this PR

Closes #64752

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

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 with failed to open output file ... No such file or directory until a restart (the daemon refuses to create the pipe; the spawner's write stream fails).

Shell.create now 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 an AppProcessError before 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?

  • New tests in packages/core/test/shell-daemon.test.ts remove the shell directory between two commands, for the daemon path and the spawner fallback. Both fail on dev and pass here (--rerun-each 10).
  • Existing shell tests (shell-daemon, shell-retention, shell-cleanup, shell-restart, session-shell, tool-shell) still pass. The two tool-shell "conditional substitutions" failures happen on dev too.
  • bun run check passes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Added by the opencode bot (AI-generated).

Related: #59817, #62763

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@neriousy
fix(core): recreate the shell output directory before each command
87e8c14
opencodejr[bot]
opencodejr Bot reviewed Nov 19, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Related: #59817, #62763

Before

After

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@neriousy neriousy changed the title fix(core): recreate the shell output directory before each command fix(core): keep shell commands working after their output directory is removed Nov 19, 2026
@neriousy
neriousy merged commit c740f6d into dev Nov 19, 2026
15 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@neriousy
neriousy deleted the shell-output-dir branch November 19, 2026 14:40
joe-ieta pushed a commit to joe-ieta/OpenCode.My that referenced this pull request Nov 19, 2026
@neriousy @joe-ieta
fix(core): keep shell commands working after their output directory i…
e484bb9
…s removed (anomalyco#64889)

(cherry picked from commit c740f6d)
@neriousy neriousy mentioned this pull request Nov 23, 2026
server: mkdir EEXIST on shell/<projectID> makes session silently fall back to home directory #59817
Closed
@BrewTestBot BrewTestBot mentioned this pull request Nov 23, 2026
opencode 2.4.0 Homebrew/homebrew-core#327368
Merged
@amrkmn amrkmn mentioned this pull request Nov 23, 2026
opencode 2.4.0 amrkmn/homebrew-tap#1251
Closed
1 task
@github-actions github-actions Bot mentioned this pull request Nov 23, 2026
feat: opencode release v2.4.0 sprisa/opencode-server#95
Merged
@scottames-github-bot scottames-github-bot Bot mentioned this pull request Nov 27, 2026
chore(deps): update ⬆️ mise-packages scottames/dots#1181
Merged
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencodejr opencodejr[bot] opencodejr[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

shell: output capture fails - missing ~/.local/share/opencode/shell directory

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@neriousy
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.