Add --edw-rpc and Mix eval BEAM recovery - #13
Conversation
The host evaluates Elixir on a running node with erl_call. After three startup crashes the host runs Mix eval, then starts again. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 4 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fc6a1fd. Configure here.
| cmd << "cmd.exe /c \"" << bin << "\" eval \"" << expr << "\""; | ||
| } else { | ||
| cmd << '"' << bin << "\" eval \"" << expr << '"'; | ||
| } |
There was a problem hiding this comment.
Broken Windows recovery command quoting
High Severity
--edw-recover and automatic crash recovery wrap Code.eval_file("...") in extra quotes and pass it through cmd.exe /c. Nested " characters break Windows command-line parsing, so the Mix eval argument is split and recovery does not run.
Reviewed by Cursor Bugbot for commit fc6a1fd. Configure here.
| std::wstring wwd = utf8_to_wide(wd); | ||
| auto env = env_block(extra); | ||
| DWORD flags = CREATE_UNICODE_ENVIRONMENT | CREATE_NO_WINDOW; | ||
| if (!CreateProcessW(nullptr, mutable_cmd.data(), nullptr, nullptr, TRUE, flags, env.data(), |
There was a problem hiding this comment.
Recovery spawn lacks a console
Medium Severity
Windows recovery eval is launched with CREATE_NO_WINDOW and no new console. Packaged start already uses CREATE_NEW_CONSOLE because OTP 26's logger crashes or enters nouser without real stdio. Automatic recovery from the GUI host can fail even when a script is present.
Reviewed by Cursor Bugbot for commit fc6a1fd. Configure here.
| let proc = Process() | ||
| proc.executableURL = URL(fileURLWithPath: erlCall) | ||
| proc.arguments = args | ||
| proc.environment = ProcessInfo.processInfo.environment |
There was a problem hiding this comment.
macOS RPC drops extra environment
Medium Severity
macOS --edw-rpc sets erl_call's environment to the process environment only and skips ini [env]. Linux and Windows merge extra_env, and macOS recovery already does. RPC on macOS can miss PATH or other release overrides required to reach the node.
Reviewed by Cursor Bugbot for commit fc6a1fd. Configure here.
| if (beamcli::maybe_run_exclusive(config, &exclusive)) { | ||
| CoUninitialize(); | ||
| return exclusive; | ||
| } |
There was a problem hiding this comment.
Windows restart cap exits successfully
Medium Severity
After restart_max_attempts the Windows host posts PostQuitMessage(1) but wWinMain always return 0. Linux and macOS now exit(1) on the same path. Crash-loop termination therefore looks like success to Windows launchers and scripts.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit fc6a1fd. Configure here.


Summary
--edw-rpcas a one-shot Elixir eval on a running BEAM node viaerl_call.evalrecovery, then start again.Test plan
NO_WX=1 mix test test/e2e/rpc_test.exs test/e2e/restart_test.exs(macOS host)macos-e2e,linux-e2e, andwindows-e2e--edw-rpcand--edw-recovertogether exit with a non-zero statusMade with Cursor