fix: preserve quoted NODE_OPTIONS while stripping cmux preload - #16031
Conversation
The wrapper's NODE_OPTIONS restore preload lives in $TMPDIR, so once macOS purges it every later Node child exits with MODULE_NOT_FOUND. Ported from #12067. Co-authored-by: Austin Wang <austinwang115@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both the claude wrapper and the claude-teams/omc launchers wrote the restore preload to $TMPDIR, which macOS purges under long-lived sessions, after which every Node child fails with MODULE_NOT_FOUND. Write it to ~/.cmuxterm/cmux-claude-node-options (0700, atomic temp-and-rename) alongside the other CLI shims, and quote the --require path when $HOME contains whitespace. Co-authored-by: Austin Wang <austinwang115@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The TMPDIR test rewrite dropped this function while main() still calls it, so the Claude wrapper lane stopped with a NameError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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 2 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. Review configuration: ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (3)
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 |
|
All contributors have signed the CLA ✍️ ✅ |
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
CI failure attributionCI failed on
Not re-run automatically: Written by |
|
|
|
Merge receipt for
Labeled |
|
This PR broke
|
…ests #16031 added testClaudeResumeCommandStripsQuotedCmuxNodeOptionsRestoreModuleInHomeWithSpace next to an existing test of the same name, so cmuxTests no longer compiles and the shard planner rejects the duplicate selector. The older one keeps a user --require, so name it for that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FrR7YbsQtGw2eFtDeyiTcK
* test: repair four package test targets that main stopped compiling or passing - CmuxAgentJournal: #15279 called draft(to:senderSurfaceId:body:) after #15863 put body before senderSurfaceId. - CmuxFoundation: #16378's Codex TOML tests expected an appended [features] table, but the editor rewrites an existing hooks = false in place inside its marker block. Assert that block instead. - CmuxSwiftRenderUI: #16408's allSatisfy(\.isValid) inside #expect does not compile (the macro makes the key path a throwing argument). - CmuxUpdaterUI: #16357 reverted UpdateBadge.hostedIconRequest and the CmuxAppKitSupportUI dependency but left #15756's UpdateBadgeTests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FrR7YbsQtGw2eFtDeyiTcK * ci: let consumer app-host tests find the source tree again #16116 dropped the /private/tmp/cmux-ci/src alias in favor of CMUX_CI_RUNTIME_SOURCE_ROOT, but xcodebuild only forwards TEST_RUNNER_ variables to the test host, so SwiftTestingAssertions.sourceURL() fell back to the producer's #filePath. On a consumer runner that never compiled, dozens of source-backed tests (shell integration, wrappers, source scans) then fail with file-not-found. Forward the root as TEST_RUNNER_CMUX_CI_RUNTIME_SOURCE_ROOT, and alias the producer's canonical src to this checkout when nothing is there, for raw #filePath users (cmuxCLITests, CLI dev-resource fallbacks). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FrR7YbsQtGw2eFtDeyiTcK * test: repair two agent notification tests main never ran green - AgentSemanticNotificationDeliveryTests (#15974): enqueue a session- scoped prompt only after binding that session to the surface, which notificationRequestIsCurrent has required since #11976. The PR merged with its app-host shards cancelled. - testCodexStopWithMissedPromptSubmitClearsTerminalStaleTurn: since 2f574d6 (#15345) turn_aborted is terminal for the transcript monitor, so its Stop replay may retire the aborted turn before the next Stop does. Accept either retirement and wait for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FrR7YbsQtGw2eFtDeyiTcK * ci: drop the producer-root alias; resolve CLI test sources through the runtime root Review of 69a68d6: the restore-time alias at the producer's canonical src breaks #16116's rule that restore never touches the producer root (two wiring tests encode it) and can race a producer's rm/clone on shared Macs. Instead, the two raw #filePath sites in cmuxCLITests read CMUX_CI_RUNTIME_SOURCE_ROOT like SwiftTestingAssertions.sourceURL(), and the CLI product step forwards it as TEST_RUNNER_. The Codex aborted-turn test now captures from before the old prompt (a fast monitor replay was missed) and asserts silence only on the transcript-terminal path: the monitor replay settles the aborted turn as a completed Stop, which notifies (#15345's behavior). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FrR7YbsQtGw2eFtDeyiTcK * ci: forward the runtime source root into the console-session test runner The app-host shards run run-app-host-xcodebuild.sh through run-in-console-session.sh, which forwards only an allowlist of variables. CMUX_CI_RUNTIME_SOURCE_ROOT was not on it, so the TEST_RUNNER_ forwarding never fired and sourceURL() kept falling back to the producer's #filePath (run 36903763717 still showed /tmp/cmux-ci/src). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FrR7YbsQtGw2eFtDeyiTcK * ci: give the standalone CLI under test its bundled opencode plugin The CLI product job tests Build/Products/Debug/cmux, where none of the CLI's resource candidates exist, so 'hooks opencode install' only found the plugin through its #filePath fallback into the source tree. Place it beside the executable, one of the paths the CLI already searches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FrR7YbsQtGw2eFtDeyiTcK * test: rename the older of two same-named Claude NODE_OPTIONS resume tests #16031 added testClaudeResumeCommandStripsQuotedCmuxNodeOptionsRestoreModuleInHomeWithSpace next to an existing test of the same name, so cmuxTests no longer compiles and the shard planner rejects the duplicate selector. The older one keeps a user --require, so name it for that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FrR7YbsQtGw2eFtDeyiTcK * Revert "test: rename the older of two same-named Claude NODE_OPTIONS resume tests" This reverts commit 852333a. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Parse quoted
NODE_OPTIONSarguments before removing cmux's restore preload, preserving spaces and escaped quotes in the remaining Node options and session resume commands.Changelog
none
Origin:
/Users/leoli/Projects/cmux-worktrees/pr14814-quoting(source checkoutcmux-worktrees/pr14814-quoting).Verification
Not run during idle-checkout triage; this draft needs the focused agent-launch and session-persistence tests.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes Claude Node children dying with MODULE_NOT_FOUND after macOS purges
$TMPDIRduring long-lived sessions by keeping the restore preload in~/.cmuxterm, and makes preload stripping preserve quoted arguments when$HOMEcontains spaces.~/.cmuxterm/cmux-claude-node-options(0700) instead of$TMPDIR, and the--requirepath is quoted when it contains whitespace.$TMPDIRno longer disables the injection.Written for commit be89b71. Summary will update on new commits.