Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7349ebb645
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const shell = process.env.SHELL ?? ""; | ||
| needsWrapper = shell.includes("/fish"); |
There was a problem hiding this comment.
Handle non-fish shells in auto wrapper detection
createSession() now defaults to bashWrapper: "auto", but auto mode only enables wrapping when $SHELL contains "/fish"; every other shell path is treated as compatible. Because the startup command always prepends POSIX-style unset/export, users running tmux under other non-POSIX shells (or fish environments where $SHELL is not a full /.../fish path) will execute the unwrapped script and the new session can fail immediately, which is a regression from the previous always-wrapped behavior.
Useful? React with 👍 / 👎.
lucabarak
left a comment
There was a problem hiding this comment.
Verified on VM against v0.9.1: 146/146 Pi + tmux tests pass, biome + tsc clean. Code review of all 3 commits looks solid.
Pi detectReady fix — correct call. The status bar regex (\d+\.\d+%\/\d+k) is distinctive enough to be the sole readiness signal now that Pi >=0.55 dropped the header.
bashWrapper config — clean solution to the fish-vs-Pi quoting conflict. Auto-detecting $SHELL for fish and only wrapping when needed is the right trade-off. The Codex bot flagged that auto mode only catches fish (not csh/tcsh/nushell) — that's fair but practically low-risk, and "always" is available as a fallback for anyone hitting it.
One minor style note (not blocking): all 4 callers pass undefined for maxRetries to reach the bashWrapper parameter. If this pattern grows, an options object might be worth considering in a follow-up.
Heads up: this branch is based on v0.8.7 — it'll need a rebase onto current main (v0.9.1) before merge. The conflicting files (coordinator.ts, sling.ts) have changes in different functions so the rebase should be straightforward.
LGTM — approve pending rebase.
jayminwest
left a comment
There was a problem hiding this comment.
Review
Good fix for two real Pi runtime issues (readiness detection regression in Pi >=0.55 and bash wrapper breaking Pi's subshell quoting). The bashWrapper config approach is well-designed. Main blocker is the rebase.
Must fix
- Rebase required onto main (v0.9.1) — The branch is based on v0.8.7.
coordinator.tson main now passes additional arguments (coordinatorName,profileFlag) tocreateSession. The diff will not apply cleanly. Should be a straightforward rebase since changes are in different functions.
Should fix
-
Missing config validation for
bashWrapper— Other runtime config fields are validated invalidateConfig(), butbashWrapperis not. A user settingbashWrapper: "yes"would silently fall through to the"auto"default. Add a quick validation block like other runtime fields:if (config.runtime?.bashWrapper !== undefined) { const valid = ["auto", "always", "never"]; if (!valid.includes(config.runtime.bashWrapper)) { // warn and default to "auto" } }
-
No test for
"always"mode — Tests cover"auto"(both shells) and"never", but not"always"forcing bash wrapping on a POSIX shell. Trivial addition alongside the existing"never"test.
Non-blocking suggestions
- Positional parameter sprawl in
createSession(all 4 callers passundefinedformaxRetriesto reachbashWrapper). An options object would be cleaner — could be a follow-up. - The
requiresBeaconVerification()JSDoc inpi.tsstill mentions the header being present — should reflect Pi >=0.55 dropping it.
|
This looks superseded by #129 now. The newer branch carries the current Pi startup/readiness contract work on top of current |
Pi >=0.55 dropped the 'pi v<version>' header from the TUI startup screen. The previous detectReady required both the header AND the status bar token counter to be present. Since the header is gone, coordinator and agent startup always timed out. The status bar regex (matching patterns like '0.0%/200k') is sufficiently distinctive to serve as the sole readiness signal.
The bash -c wrapper added in GitHub jayminwest#86 (fish shell fix) breaks runtimes whose spawn commands contain complex quoting — notably Pi's $(cat '/path/to/file') subshell expansion, where nested single quotes get mangled by the wrapper's escaping. Add a runtime.bashWrapper config option ('auto' | 'always' | 'never') that controls whether tmux session startup commands are wrapped in /bin/bash -c. The default 'auto' mode detects the user's $SHELL and only wraps for non-POSIX shells (fish), preserving the original fix while avoiding breakage for bash/zsh users. Threaded through coordinator, sling, monitor, and supervisor spawn paths via the existing config.runtime namespace.
…SDoc - Add runtime.bashWrapper validation in validateConfig() with warning and fallback to 'auto' for invalid values - Add test for 'always' mode forcing bash wrapping on POSIX shells - Update requiresBeaconVerification JSDoc to reflect header removal
7349ebb to
f750bf7
Compare
Hey Jaymin,
I ran into this while using Overstory with the Pi runtime on a real project and put together a small fix.
After updating, Pi-based startup was failing for me for two reasons. Pi no longer seems to show the old
pi v...header consistently, so readiness detection could time out even though it was already up. On top of that, the bash wrapping added for fish shell compatibility was breaking Pi startup in my setup.This PR relaxes Pi readiness detection and adds a small config option for bash wrapping so fish users keep the existing behavior without forcing it for everyone else.
I also added test coverage for the Pi readiness case and the wrapper behavior.
With these changes, Pi-based coordinator startup worked again locally on my side.