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): name the shell in the shell tool's Code Mode description by rekram1-node · Pull Request #65712 · anomalyco/opencode

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Nov 23, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Issue for this PR

Closes #

Type of change

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

What does this PR do?

With full_codemode on, the shell tool's description never said which OS and shell commands run in ("Commands run on macOS using zsh."). Session hooks added that sentence to the direct tool definitions each request, but under full_codemode shell is listed in the Code Mode catalog instead (#64284, #64515), so the hooks found nothing to change.

The tool now reads the shell when it is built and names it in both its direct and its Code Mode description. The context, compaction and generate hooks that patched it are gone. ShellSelect now publishes an internal shell-select.updated Bus event when the selected shell changes (defined in core, so it isn't part of the public event list), the same way agents and web search announce updates, and the shell tool rebuilds on it. The description always names the shell commands actually use, whichever plugin set it, and changing shell in config updates it after the selection reloads instead of depending on which plugin hears the config change first. The description is still the same string on every request, so it doesn't affect prompt caching.

How did you verify your code works?

bun run check passes. Shell tool, shell target environment, machine path, session shell and Code Mode tests pass, plus automation shell and config command tests. Two conditional process substitution tests in tool-shell.test.ts fail on my machine with and without this change.

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

Checklist

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

Sorry, something went wrong.

Uh oh!

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

All reactions
rekram1-node added 2 commits November 22, 2026 23:09
@rekram1-node
fix(core): name the shell in the shell tool's Code Mode description
341a9cb
@rekram1-node
fix(core): read the shell setting from the tool's own config for its …
374ce18
…description
opencodejr[bot]
opencodejr Bot reviewed Nov 23, 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 Code Mode fix works. With full_codemode, the pinned shell catalog entry now names the shell (Commands run on Linux using bash.); on the base it named none. The direct definition names it too. I checked this with temporary logging in the existing tool-shell.test.ts Code Mode and registry tests on the base and on the PR. Shell tool, target environment and machine path tests pass (157 pass, 23 skip). tsc -b for packages/core passes.

The public API is unchanged.

One regression, explained inline: once shell is changed in config, the description keeps naming the old shell until something else rebuilds the tools. The removed hooks looked up the shell on every request, so they never had this problem. I reproduced it: after changing opencode.json from /usr/bin/sh to /usr/bin/bash, shell selection gave /usr/bin/bash, but the description still said sh.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread packages/core/src/tool/plugin/shell.ts Resolved

Uh oh!

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

@rekram1-node
refactor(core): rebuild the shell tool when the selected shell changes
96e1508
opencodejr[bot]
opencodejr Bot reviewed Nov 23, 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 stale shell name after a config change is fixed. I reran the earlier test: after opencode.json changes from /usr/bin/sh to /usr/bin/bash, the shell tool description now names bash. Shell, config command and pty tests pass, and tsc -b for packages/core passes.

The public API is unchanged. ShellSelect.Interface gains a required changes stream, but that interface is internal to core, and its only other implementation, a test stub, was updated.

Sorry, something went wrong.

Uh oh!

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

All reactions
@rekram1-node
refactor(core): announce shell selection changes with an internal Bus…
7f8d290
… event
opencodejr[bot]
opencodejr Bot reviewed Nov 23, 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.

Switching to the internal shell-select.updated Bus event keeps the fix. After opencode.json changes from /usr/bin/sh to /usr/bin/bash, the shell tool description names bash. The shell, config command, pty and subagent tests pass, and tsc -b for packages/core passes.

The public API is unchanged. The new event is an ephemeral core event, like wellknown.updated, and isn't part of the SDK or OpenAPI event list.

Sorry, something went wrong.

Uh oh!

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

All reactions
@rekram1-node
rekram1-node merged commit 825986a into dev Nov 23, 2026
12 checks passed

Uh oh!

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

@rekram1-node
rekram1-node deleted the shell-description branch November 23, 2026 05:42
@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
@Sniezka1927 Sniezka1927 mentioned this pull request Nov 25, 2026
Use Windows PowerShell for OpenCode when PowerShell 7 is only the Store alias nightly-labs/openbot#16863
Merged
6 of 10 tasks
@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.

Uh oh!

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

1 participant

@rekram1-node
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.