Skip to content

fix(aside): the readiness probe can never detect Aside under zsh - #2824

Open
AntonioVitalic wants to merge 1 commit into
garrytan:mainfrom
AntonioVitalic:fix/aside-probe-zsh-word-splitting
Open

fix(aside): the readiness probe can never detect Aside under zsh#2824
AntonioVitalic wants to merge 1 commit into
garrytan:mainfrom
AntonioVitalic:fix/aside-probe-zsh-word-splitting

Conversation

@AntonioVitalic

Copy link
Copy Markdown

What's broken

The Aside readiness probe builds its deadline wrapper into a variable and expands it unquoted:

_T=""; command -v gtimeout >/dev/null 2>&1 && _T="gtimeout 30";elif $_T aside repl 'console.log("ASIDE_READY " + pwd)' 2>&1 | grep -q '^ASIDE_READY'; then

$_T only splits into gtimeout + 30 in a shell that word-splits unquoted expansions. zsh does not. There it looks for a command literally named gtimeout 30:

$ zsh probe.sh
(eval):1: command not found: gtimeout 30
ASIDE_NOT_RUNNING

zsh is the default shell on macOS and Aside is macOS-only, so on a stock Mac the probe reports ASIDE_NOT_RUNNING regardless of what Aside is actually doing, and every browsing skill falls back to the bundled Chromium in silence. Measured with Aside 1.26.906.1630 installed, signed in, and answering aside repl in 5 ms. The same line under bash runs the wrapper fine, which is why it reads as correct.

The fix

Keep the deadline chain exactly as it is (gtimeout → timeout → perl alarm) and route the call through eval, which splits in sh, bash and zsh alike:

_ASIDE_JS='console.log("ASIDE_READY " + pwd)'
elif eval "${_T:+$_T }aside repl \"\$_ASIDE_JS\"" 2>&1 | grep -q '^ASIDE_READY'; then

${_T:+$_T } keeps the no-wrapper case clean on a stock macOS that has neither coreutils nor perl: the prefix collapses to nothing instead of leaving a stray space.

Verified READY: aside 1.26.906.1630 in zsh, bash and sh, with GSTACK_SKIP_ASIDE=1 still short-circuiting to NEEDS_ASIDE.

Scope

  • scripts/resolvers/aside.ts — the change itself.
  • The 20 generated SKILL.md files, regenerated with bun run gen:skill-docs rather than edited by hand.
  • The 3 test/fixtures/golden/ fixtures, regenerated the same way test/host-config.test.ts renders them (--host codex, --host factory, plus ship/SKILL.md for claude). Without this the golden comparison fails, since it diffs a fresh render byte for byte.
  • test/aside-driver.test.ts — the assertion pinned the broken invocation verbatim, so it now pins the eval form and asserts $_T aside repl is gone.

bun test test/aside-driver.test.ts test/host-config.test.ts → 104 pass, 0 fail.

Introduced in #2810.

The probe built its deadline wrapper into `_T` and expanded it unquoted, so
`$_T aside repl …` only worked in a shell that word-splits. zsh does not: it
looked for a command literally named "gtimeout 30", the probe answered
ASIDE_NOT_RUNNING with Aside installed and ready, and every browsing skill
fell back to the bundled Chromium in silence. zsh is the macOS default and
Aside is macOS-only, so on a stock Mac the probe could never report READY.

`eval` splits in sh, bash and zsh alike. The deadline chain is unchanged and
`${_T:+$_T }` keeps the no-wrapper case clean when neither coreutils nor perl
is present. Verified READY in the three shells, with GSTACK_SKIP_ASIDE=1 still
short-circuiting to NEEDS_ASIDE.

The test pinned the broken invocation verbatim, so it now pins the eval form
and asserts the old one is gone.
@trunk-io

trunk-io Bot commented Sep 7, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

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.

1 participant