Skip to content

Add --edw-rpc and Mix eval BEAM recovery - #13

Merged
dominicletz merged 11 commits into
masterfrom
feat/edw-rpc-and-restart
Sep 13, 2026
Merged

dominicletz merged 11 commits into
masterfrom
feat/edw-rpc-and-restart

Conversation

@dominicletz

Copy link
Copy Markdown
Contributor

Summary

  • Add --edw-rpc as a one-shot Elixir eval on a running BEAM node via erl_call.
  • Restart BEAM after a crash. After three startup crashes, run Mix eval recovery, then start again.
  • Cover both CLIs with Elixir E2E on the shared suite.

Test plan

  • NO_WX=1 mix test test/e2e/rpc_test.exs test/e2e/restart_test.exs (macOS host)
  • CI macos-e2e, linux-e2e, and windows-e2e
  • Confirm --edw-rpc and --edw-recover together exit with a non-zero status

Made with Cursor

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>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 4 potential issues.

Fix All in Cursor

❌ 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.

Comment thread native/windows/src/beam_cli.cpp
Comment thread native/windows/src/beam_cli.cpp
Comment thread native/macos/Sources/DesktopWebView/BeamCli.swift Outdated
Comment thread native/windows/src/main.cpp
dominicletz and others added 10 commits September 10, 2026 15:20
CI has no epmd, so Node.start failed. Windows Mix eval now uses cmd /s quoting and a hidden console. The host returns the WM_QUIT code.

Co-authored-by: Cursor <cursoragent@cursor.com>
Windows epmd -daemon does not return, so the host starts it without a wait.
Recovery now writes a .cmd file and runs it with COMSPEC, so eval reaches the bat.

Co-authored-by: Cursor <cursoragent@cursor.com>
cmd.exe /c drops extra quoted eval args. A temp .cmd with no pipe chars matches packaged start.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add the single-instance spec and rewrite --edw-rpc off erl_call. The
control socket stays separate from the Elixir EDW TCP client.

Co-authored-by: Dominic Letz <dominicletz@users.noreply.github.com>
Bind a per-user lock when instances=single. Second launch sends
instance.activate. --edw-rpc is a control-socket client that forwards
rpc.eval to the connected Elixir Transport. Drop erl_call.

Co-authored-by: Dominic Letz <dominicletz@users.noreply.github.com>
Linux Elixir E2E covers instance.activate and --edw-rpc. Shared suite is the source of truth for all hosts.

Co-authored-by: Dominic Letz <dominicletz@users.noreply.github.com>
on_exit Process.exit/2 on a dead drain pid can hit the next ExUnit
test after pid reuse. Only kill the drain while it still owns the port.

Co-authored-by: Dominic Letz <dominicletz@users.noreply.github.com>
Close the port and terminate the host OS pid. Do not kill a stored
drain pid. Unlink Transport from the E2E test process.

Co-authored-by: Dominic Letz <dominicletz@users.noreply.github.com>
Copy the remaining byte count before withUnsafeMutableBytes so
the exclusive buffer access does not overlap buf.count.

Co-authored-by: Dominic Letz <dominicletz@users.noreply.github.com>
…-eval-282d

Native single-instance and control-socket rpc.eval
@dominicletz
dominicletz merged commit 39a1849 into master Sep 13, 2026
4 checks passed
@dominicletz
dominicletz deleted the feat/edw-rpc-and-restart branch September 13, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants