Repository navigation
feat(muse-proxy): tolerate per-CLI flag differences via --help capability probe - #775
Conversation
The sandbox can only reach Meta through its unauthenticated egress proxy + CA bundle, but fleet machines with direct network access (the laptop) must not pin either for the CLI children. MUSE_PROXY_EGRESS now overrides the pinned proxy URL; setting it empty disables the pinning entirely, and the CA bundle is only pinned when the file exists. Sandbox behaviour is unchanged (same default pin, CA present). This folds the laptop deployment's local adaptation into the fleet code so both machines run the same file.
The fleet runs muse CLIs with different flag surfaces side by side: 1.4.2 (laptop) advertises neither serve --disable-request-user-input nor exec --disable-reminders, and an unknown option kills the child before it can serve anything — the warm proxy deployed there failed every turn instantly. 1.4.13 (sandbox) advertises both. Probe `serve --help` / `exec --help` on the resolved binary once at startup, cache the advertised flag sets, and build both spawn argvs from them. No version strings are compared. If a probe fails, optional flags are omitted and core flags are still passed, so the proxy degrades instead of dying. /health reports the probe state and the dropped flags per subcommand. Tests: the stub muse gains canned --help surfaces (1.4.2-shaped by default, 1.4.13-shaped with STUB_HELP_ALL_FLAGS=1) and argv logging; four new tests pin the omission/pass-through behaviour for both the exec and warm serve spawns. 13/13 pass.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 57 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ccb2cacebb
ℹ️ 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".
| child.on('close', () => { | ||
| clearTimeout(timer); | ||
| const flags = new Set(out.match(/--[a-z][a-z0-9-]*/g) || []); | ||
| resolve(flags.size > 0 ? flags : null); |
There was a problem hiding this comment.
Reject failed capability probes before caching their flags
If either help process exits unsuccessfully or is killed after emitting a diagnostic containing a --flag, this handler treats that output as a successful capability probe. For example, a failed probe mentioning --help produces a capability set containing only that flag; the exec argument builder then removes every planned option, including --prompt-file and --json, so subsequent requests launch bare muse exec without the user's prompt. This incorrect capability set is cached until restart. Check the exit code and signal before parsing, and return null for failed or timed-out probes so the existing core-preserving fallback applies.
Useful? React with 👍 / 👎.
Stacked on #769 (base:
warm/muse-proxy-serve-pool). Left open for review; not merged.Problem
The warm muse-proxy from #769 spawns
muse serve --provider meta --disable-request-user-inputand its exec fallback passes--disable-reminders. The fleet runs two muse CLI releases side by side whose flag surfaces differ (both--helpoutputs captured and compared 2026-10-24):--disable-request-user-input--disable-remindersAn unknown option kills the child before it serves anything, so on the laptop every muse turn failed instantly (HTTP 500) while the sandbox worked.
Fix (commit ccb2cac)
serve --helpandexec --helponce, caches the advertised--flagsets, and builds both spawn argvs from them — only advertised flags are passed. No version strings are compared, so future CLIs land wherever their help says./healthnow reportscliFlags: { serveProbed, execProbed, dropped: { serve, exec } }.Also in this PR (commit 3955bc5)
The laptop deployment carried one local adaptation the sandbox build lacked: the egress pin was overridable (
MUSE_PROXY_EGRESS, empty = no pinning; CA bundle pinned only when the file exists). That is folded into the fleet code verbatim so both machines run the same file; sandbox behavior is unchanged (same default pin, CA present).Tests
node --test bin/muse-proxy.test.mjs— 13/13 pass (9 pre-existing + 4 new). The stubmusegains canned--helpsurfaces (1.4.2-shaped by default, 1.4.13-shaped withSTUB_HELP_ALL_FLAGS=1) and argv logging; the new tests pin omission/pass-through for both the exec spawn and the warm serve spawn, plus the/healthdropped-flag report.Need help on this PR? Tag
@codesmith-botwith what you need.