Repository navigation
fix(aside): the readiness probe can never detect Aside under zsh, and hides why it fails - #2870
Closed
AntonioVitalic wants to merge 1 commit into
Closed
AntonioVitalic wants to merge 1 commit into
AntonioVitalic wants to merge 1 commit into
Conversation
|
Merging to
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 |
4 of 5 tasks
AntonioVitalic
force-pushed
the
fix/aside-probe-zsh-word-splitting
branch
2 times, most recently
from
September 15, 2026 22:18
3b9df36 to
a9b787f
Compare
AntonioVitalic
added a commit
to AntonioVitalic/gstack
that referenced
this pull request
Sep 15, 2026
AntonioVitalic
force-pushed
the
fix/aside-probe-zsh-word-splitting
branch
from
September 17, 2026 15:54
a9b787f to
20fb6b5
Compare
AntonioVitalic
force-pushed
the
fix/aside-probe-zsh-word-splitting
branch
3 times, most recently
from
September 22, 2026 19:29
20929cb to
90ebf9e
Compare
AntonioVitalic
force-pushed
the
fix/aside-probe-zsh-word-splitting
branch
from
September 23, 2026 14:52
90ebf9e to
65ad60d
Compare
… failed The probe built its deadline 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. The deadline becomes a function, `_gs_d`. It receives the command as "$@", already split, so sh, bash and zsh all behave the same, and the gtimeout → timeout → perl alarm chain is unchanged. A 4th arm runs the call unbounded when none of the three is present, which is what the empty `_T` did before. Not `eval`: it re-parses the string, so the parens and `;` of the perl arm become syntax and that arm dies in bash *and* zsh — on a stock Mac, the arm that actually runs. On failure the probe now prints the CLI's reason after ASIDE_NOT_RUNNING:, the shape gstack-render already uses: the first line that starts with a capital letter, i.e. the CLI's own sentence or Node's `Error:` line below its loader frame. "Not running" covers states with different fixes — no window open for the profile, a NODE_OPTIONS preload that kills the CLI — and a bare verdict sent all of them to "open the Aside app". The BROWSER SETUP prose quotes that reason before asking the user to open the app. The text pin asserted the broken invocation verbatim, so it now pins the function and asserts neither `$_T aside repl` nor an eval form comes back. A second test executes the rendered probe in sh, bash and zsh on each of the four deadline arms with stubbed binaries on a narrowed PATH, plus two failing CLIs: one that prints its own sentence, one that crashes like Node with the useful line below the frame. The deadline function costs zero bytes against the lines it replaces; the reason costs 53 per copy of the probe (44 where the reworded BROWSER SETUP line gives 9 back). That moves four guards by the measured amount: plan-devex-review's skeleton cap to 68,550 (measured 68,544), plan-ceo-review's skeleton cap to 80,150 (measured 80,111) and union ratio to 1.081 (measured 1.0803), and plan-eng-review's union ratio to 1.151 (measured 1.1504). Fixes garrytan#2842, garrytan#2941.
AntonioVitalic
force-pushed
the
fix/aside-probe-zsh-word-splitting
branch
from
September 24, 2026 12:32
65ad60d to
7baa3e7
Compare
3 of 5 tasks
Contributor
Author
|
Superseded by #2959, which landed this change in v1.91.2.0 ( Thank you for folding it into the wave and for keeping me on the commit as a co-author — I really appreciate it. Closing. |
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.
Fixes #2842, #2941. Supersedes #2824 — same branch, same author, same fix; that PR was auto-closed when a force-push from a shallow clone left the branch without a common ancestor with
main, and GitHub refuses to reopen a PR whose branch was force-pushed after the close. The history is repaired here: this head is a normal child ofmain.Why (in your own words)
On any machine whose shell is zsh — the macOS default, and what agent harnesses run their shell tool as — the BROWSER SETUP probe answers
ASIDE_NOT_RUNNINGwhile Aside is running fine. The status line is the small part. The damage is that every browsing skill then silently drops to the bundled headless browser, which has none of the user's cookies or logged-in sessions, so a page behind a login comes back signed-out and the skill blames the site instead of the probe. #2810 made Aside the browser gstack drives first; under zsh that contract was unreachable, and Aside only ships for macOS, where zsh is the shell.The probe holds its deadline in a variable and expands it unquoted, so it only becomes two words in a shell that word-splits unquoted expansions. zsh does not — it looks for one command named
gtimeout 30. The variable is the vehicle for all three deadline arms, so under zsh every arm fails, including the perl arm that is the only one present on a stock Mac.This change makes the deadline a function,
_gs_d, which takes the command as"$@", already split, and behaves identically in sh, bash and zsh.It also stops the probe from hiding why it failed. "Not running" covers states with different fixes — no window open for the profile, a
NODE_OPTIONSpreload that kills the Node-built CLI — and a bare verdict sends every one of them to "open the Aside app". The failure line now carries the CLI's reason,ASIDE_NOT_RUNNING: <reason>, the same shapegstack-renderalready reports; the BROWSER SETUP prose, which already asked the agent to "quote the probe output verbatim" — output the probe used to throw away — now quotes that reason before asking the user to open the app.Live evidence
Environment: macOS 15 (Darwin 25.6.0), zsh 5.9, bash 3.2.57, aside 1.26.906.1630 — installed, signed in, answering
aside replin ~5 ms throughout. Measured againstmainat v1.89.0.0 (06ed920a), with this branch rebased onto it. Each row narrows PATH so a different deadline arm is selected; the probe is extracted verbatim from the renderedbrowse/SKILL.mdof each tree, not retyped.The mechanism, isolated:
Before —
mainat v1.89.0.0, still broken on the current release. Aside was up the whole time:After — this branch:
READYis the full lineREADY: aside 1.26.906.1630in every cell; trimmed here for width. Thenone of the threerow is why the 4th arm exists: today's empty_Tstill runs the call, so a function withoutelse "$@"would drop it.The failure reason, with the real CLI and the preload from #2941 (a
--requirewhose file is gone). The aside binary is a Node single-executable and honorsNODE_OPTIONS, so it dies before it runs; the useful line sits below Node's loader frame, which is why the probe prints the first line that starts with a capital letter rather than the first line:Same result under bash for both trees.
Why not
eval.evalsplits in all three shells and is the obvious one-liner — this PR carried it until I measured the perl arm.evalre-parses the string, so the parens and the;inperl -e alarm(shift);exec(@ARGV) 30stop being data and become syntax:A stock Mac has no Homebrew coreutils and no GNU
timeout, but does have/usr/bin/perl— soevaltrades the zsh bug for a regression on the default macOS install, and takes bash down with it. Recorded here so the next person doesn't reach for it. The same reasoning rules out${=_T}(zsh-only): anything that keeps the deadline a string has to re-split or re-parse it.Those tables are now a test. The old pins asserted the probe's text, which is how a shape that had never run under zsh satisfied every one of them.
test/aside-driver.test.tsnow renders the probe and executes it: 3 shells × 4 deadline arms, with a stubasideand stubgtimeout/timeouton a narrowed PATH so the arm under test is the only one reachable, plus bothNEEDS_ASIDEexits, plus two failing CLIs in every shell — one that prints its own sentence, one that crashes like Node with the useful line below the frame. Putmain's resolver back under this branch's test and the first zsh cell fails while sh and bash stay green in the same run — the bug, in one assertion:(The text pins go red in that run too — same swap.) Printing the first line instead of the capital-letter one fails the Node case with
node:internal/modules/cjs/loader:1573. On this branch: 29 pass, 0 fail, 1.7 s idle for the file with its 20 probe runs; the test carries a 30 s ceiling for a loaded CI box, not a wait.What it costs in the skeleton budgets
The probe renders into 19 browsing skeletons, several with single-digit headroom, so each half is sized on purpose.
main's exact spelling (alarm(shift);exec(@ARGV)), and no2>&1oncommand -v, which writes nothing to stderr when a command is missing (checked in zsh, bash, sh, dash and ksh). The rationale lives inscripts/resolvers/aside.tsas a TS comment, not in the emitted bash.mainat v1.89.0.0,plan-eng-review's union ratio sits 2 bytes under its cap, so no form of the reason fits without moving guards. It moves four intest/helpers/carve-guards.ts, each by exactly the measured amount and with the measurement in the comment as the other entries carry it:plan-devex-review's skeleton cap 68,500 → 68,550 (measured 68,544),plan-ceo-review's skeleton cap 80,100 → 80,150 (measured 80,111) and union ratio 1.08 → 1.081 (measured 1.0803), andplan-eng-review's union ratio 1.15 → 1.151 (measured 1.1504). Nothing else moves.plan-devex-reviewskeletonplan-ceo-reviewskeletonplan-ceo-reviewunion ratioplan-eng-reviewunion ratioqaunion ratioScope
scripts/resolvers/aside.ts— the deadline becomes_gs_d(), written to the byte count of the lines it replaces, same gtimeout → timeout → perl alarm order, plus a 4th arm that runs the call unbounded when none of the three exists (what the empty_Talready did); the failure line carries the CLI's reason, and the BROWSER SETUP prose quotes it first.test/helpers/carve-guards.ts— the four guards above, by the measured amount.test/aside-driver.test.ts— the assertion pinned the broken invocation verbatim, so it now pins the function, asserts the 4th arm, and asserts neither$_T aside replnor aneval … aside replform can come back; and a second test executes the rendered probe across 3 shells × 4 deadline arms and two failing CLIs with stubbed binaries, so a text pin is no longer the only thing standing between this bug and a release. The 19 generated SKILL.md files and the 3test/fixtures/golden/fixtures are regenerated, not hand-edited (bun run gen:skill-docs; goldens rendered the waytest/host-config.test.tsrenders them).mainat v1.89.0.0 (06ed920a), no conflicts; every number above is from that tree except the paired full run below, done on v1.88.1.0.browse/SKILL.mdunder zsh, bash and sh, once per deadline arm (PATH narrowed with symlink shims to select each), before and after, with Aside live — the tables above. Plus bothNEEDS_ASIDEpaths, the broken-preload case against the real CLI, and the same matrix as an executing test in the suite. Paired full run (v1.88.1.0, same machine, back to back; on v1.89.0.0 the gate suites below were re-run):bun run testexits 1 on this branch. Onmainat v1.88.1.0 it exits 124 twice in a row, with nothing else running: shard 3 wedges ontest/pty-output-wake.test.ts. Because the killed shard never finishes,main's failure list comes up short, so the files that failed only here were re-run alone on both trees. All 9 give identical results on each, among themaside-renderat 68 pass / 0 fail; its one timeout in the full run also shows up onmain, in a different case.aside-driver,parity-suite,host-config,skill-size-budget,third-party-actionsand the spawn-timeout tripwire have no failures in either run, andbun run buildfinishes clean in 5 s.command -v asideand the fallback browser takes over — that path is unchanged). Noclaude -pE2E run. The no-window state is covered by the stubbed test, not reproduced live: that means closing the windows of a signed-in Aside profile. On this machinemainitself failsbun run testbroadly — thecsosuites need Docker and the PTY/WebSocket suites are flaky — so that run separates a regression from the noise only as the paired delta above, not as a green tick.Liveness proof (required for external contributors)
Authenticated login:
gh api user --jq .login→ AntonioVitalic.GSTACK PRtyped live at my own zsh prompt — thecommand not foundunderneath is the shell answering the keystrokes, not an overlay:Checklist
$_T aside …is never word-split (and a broken NODE_OPTIONS preload is misreported as 'not running') #2941Introduced in #2810.