Skip to content

fix(developer): run shell tool under bash/sh regardless of login shell#8659

Merged
jh-block merged 1 commit into
mainfrom
jhugo/shell-fix
Apr 20, 2026
Merged

fix(developer): run shell tool under bash/sh regardless of login shell#8659
jh-block merged 1 commit into
mainfrom
jhugo/shell-fix

Conversation

@jh-block
Copy link
Copy Markdown
Collaborator

Problem

The developer extension's shell tool previously fell back to the user's $SHELL when /bin/bash wasn't present. Users with a non-POSIX login shell (fish, csh, tcsh, nu, ...) would then see failures whenever the model emitted common idioms like heredoc redirection (cat <<EOF > file), which those shells don't support.

Fixes #7348.

Fix

  • Always run commands under bash (when on PATH) or sh; GOOSE_SHELL still overrides.
  • Include the selected shell's name in the shell tool description so the model tailors syntax accordingly (and GOOSE_SHELL users get the dialect they asked for).
  • Tidy-up: use which to probe for bash instead of hard-coded paths, drop a redundant Flatpak short-circuit (the flatpak-spawn --host wrapping is unchanged), store shells as basenames so PATH resolution does the work, and factor Windows/Unix basename handling behind a shared helper.

Before, the developer extension's shell tool ran commands under the
user's $SHELL when /bin/bash wasn't present. Users with a non-POSIX
login shell (fish, csh, tcsh, nu, ...) would then see failures whenever
the model emitted common shell idioms like heredoc redirection
(`cat <<EOF > file`), since those shells don't support that syntax.

Now we always run commands under bash (when it's on PATH) or fall back
to sh. GOOSE_SHELL still overrides. The tool description also tells the
model which shell it's writing for, so it can tailor syntax (and so
GOOSE_SHELL users get the dialect they asked for).

Along the way, simplify the shell-selection logic: use `which` to
probe for bash instead of hard-coded paths, drop the redundant Flatpak
short-circuit (the `flatpak-spawn --host` wrapping is still there),
always store shells as basenames so PATH resolution does the work, and
factor the Windows/Unix basename handling behind a shared helper.

Fixes #7348

Signed-off-by: jh-block <jhugo@block.xyz>
@jh-block jh-block added this pull request to the merge queue Apr 20, 2026
Merged via the queue into main with commit e81465c Apr 20, 2026
39 of 40 checks passed
@jh-block jh-block deleted the jhugo/shell-fix branch April 20, 2026 14:56
lifeizhou-ap added a commit that referenced this pull request Apr 21, 2026
* main:
  feat(hooks): add Husky git hooks for ui/goose2 (#8577)
  fix: links in chat could not be opened (#8544)
  fix: run setup before dev and dev-debug in goose2 justfile (#8718)
  Manage skills as sources over ACP (#8675)
  handle full node paths in goose2 kill recipe (#8709)
  overhaul provider inventory and agent/model selection (#8652)
  Remove unused import (#8676)
  delete the goose2 migration plan prompt (#8678)
  Add health score badge to README (#8677)
  feat(goose2): voice dictation via direct-ACP pattern (#8609)
  consistently use actions-rust-lang/setup-rust-toolchain (#8671)
  fix(developer): run shell tool under bash/sh regardless of login shell (#8659)
  refactor(providers): extract shared OAuth device-flow helper (#8619)
  Add a goose2 release workflow (#8629)
  chore(deps): bump ncipollo/release-action from 1.20.0 to 1.21.0 (#8664)
  docs: add blog post about Mesh LLM provider option (#8655)
  fix: append /chat/completions for prefixed v1 base URLs (#8521)
  Reset ChatGPT Codex auth during OAuth setup (#8569)
  chore(deps): bump EmbarkStudios/cargo-deny-action from 2.0.15 to 2.0.17 (#8665)
  Add dependabot config for pnpm workspace, cargo, and actions (#8660)
spikewang pushed a commit to spikewang/goose that referenced this pull request Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI is incompatible to fish

2 participants