Skip to content

Remove remaining internal Node repair spawns - #276

Merged
TraderSamwise merged 5 commits into
masterfrom
feat/core-no-node-spawn-final
Jul 3, 2026
Merged

Remove remaining internal Node repair spawns#276
TraderSamwise merged 5 commits into
masterfrom
feat/core-no-node-spawn-final

Conversation

@TraderSamwise

@TraderSamwise TraderSamwise commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • route dashboard runtime-guard repair through in-process Core restart instead of spawning aimux restart --project
  • remove the Node heredoc from the tmux hyperlink helper
  • convert the one-shot Node inventory into bootstrap-allowed/runtime-forbidden regression checks

Verification

  • PATH="$HOME/.nvm/versions/node/v24.16.0/bin:$PATH" yarn typecheck
  • PATH="$HOME/.nvm/versions/node/v24.16.0/bin:$PATH" yarn lint
  • PATH="$HOME/.nvm/versions/node/v24.16.0/bin:$PATH" yarn vitest run
  • PATH="$HOME/.nvm/versions/node/v24.16.0/bin:$PATH" yarn build
  • push hook: yarn typecheck && yarn lint && yarn test

Summary by CodeRabbit

  • Bug Fixes

    • Improved runtime guard repair by restarting the control plane through a safer, lock-based flow with clearer success/failure outcomes and better handling of aborted restarts.
    • Added more control over repair behavior: optionally skip dashboard reloads and optionally ignore dashboard health during post-restart verification to reduce unnecessary actions.
    • Improved tmux hyperlink handling so pull request links resolve more reliably from status information.
  • Tests

    • Expanded coverage for guarded-repair and restart flows (including abort behavior) and tightened enforcement of allowed Node runtime launch patterns.

@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment Jul 3, 2026 4:21pm

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 89d3c3f8-aa89-4a1d-9102-ec31c6b28e88

📥 Commits

Reviewing files that changed from the base of the PR and between 7d5f2d3 and 2f80ce5.

📒 Files selected for processing (5)
  • src/multiplexer/dashboard-control.test.ts
  • src/multiplexer/dashboard-control.ts
  • src/one-shot-node-inventory.test.ts
  • src/runtime-restart.test.ts
  • src/runtime-restart.ts
📝 Walkthrough

Walkthrough

The PR switches guarded repair to restartAimuxControlPlane(), adds abort and verification controls to restart behavior, rewrites the dashboard repair tests, changes tmux PR URL lookup to Python, and expands Node launch inventory checks.

Changes

Dashboard repair restart flow

Layer / File(s) Summary
Restart options and verification
src/runtime-restart.ts, src/runtime-restart.test.ts
restartAimuxControlPlane adds abort, reload, and verification controls; post-restart verification uses the new flag, and tests cover abort release plus a restart path with dashboard reload and verification disabled.
Guarded repair uses restart promise
src/multiplexer/dashboard-control.ts
Guarded repair now runs through restartAimuxControlPlane, removes spawn-based reload helpers, and handles restart success, failure, timeout, and reload scheduling from the returned result.
Dashboard repair tests updated
src/multiplexer/dashboard-control.test.ts
The guarded-repair and refresh tests now mock restartAimuxControlPlane, use deferred promises, and assert lock handling, overlays, retries, timeouts, and verification outcomes through the new flow.

Tmux hyperlink resolver

Layer / File(s) Summary
PR URL lookup in Python
scripts/tmux-open-hyperlink.sh
resolve_pr_url() switches from inline Node.js to inline Python 3 to read statusline.json and print the PR URL for the current tmux window.

Node launch inventory checks

Layer / File(s) Summary
Bootstrap allowlist and runtime scan
src/one-shot-node-inventory.test.ts
The test now validates a two-file CLI bootstrap allowlist and separately scans source files for approved Node runtime launch patterns and getAimuxCliLaunchCommand usage.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • TraderSamwise/aimux#179: Related to the dashboard reload path in src/multiplexer/dashboard-control.ts, which this PR also changes.
  • TraderSamwise/aimux#199: Related to the restartAimuxControlPlane flow in src/runtime-restart.ts, which this PR extends with dashboard reload/verification flags.
  • TraderSamwise/aimux#240: Related to the same guarded repair workflow and lock-handling paths in src/multiplexer/dashboard-control.ts.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: removing remaining internal Node-based repair spawns.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/core-no-node-spawn-final

Comment @coderabbitai help to get the list of available commands.

@TraderSamwise

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/multiplexer/dashboard-control.ts (1)

562-571: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Reminder: rebuild dist/ for this runtime behavior change.

This changes aimux runtime repair behavior, so source-level validation alone is insufficient — run yarn build to update dist/.

As per coding guidelines: "For aimux runtime or CLI behavior changes, run yarn build to update dist/; source-level validation with yarn vitest and yarn typecheck is not enough".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/multiplexer/dashboard-control.ts` around lines 562 - 571, Source-only
changes to aimux runtime repair are not enough here; after updating the repair
flow in dashboard-control and restartAimuxControlPlane-related behavior, rebuild
the project so dist/ reflects the new runtime behavior. Run yarn build to
regenerate the compiled output and verify the updated repair
timeout/succeed/fail handling is included in the emitted artifacts.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/multiplexer/dashboard-control.ts`:
- Around line 561-574: The repair timeout path in the dashboard control flow
still leaves restart work active, so later auto-repairs can re-enter while the
original Aimux restart is running. Update the logic around
restartAimuxControlPlane(), the timeout handler, and the fail/succeed flow so
timed-out repairs are gated by the runtime restart lock state or explicitly
cancelled before another attempt can start. Use the existing lock helpers and
the repairTimeout/restart promise handling in dashboard-control.ts to ensure a
second repair cannot proceed until the in-flight restart has settled.

---

Nitpick comments:
In `@src/multiplexer/dashboard-control.ts`:
- Around line 562-571: Source-only changes to aimux runtime repair are not
enough here; after updating the repair flow in dashboard-control and
restartAimuxControlPlane-related behavior, rebuild the project so dist/ reflects
the new runtime behavior. Run yarn build to regenerate the compiled output and
verify the updated repair timeout/succeed/fail handling is included in the
emitted artifacts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2e8cc346-9302-49eb-904e-65565e437b10

📥 Commits

Reviewing files that changed from the base of the PR and between 5270b3e and 06ac3f5.

📒 Files selected for processing (4)
  • scripts/tmux-open-hyperlink.sh
  • src/multiplexer/dashboard-control.test.ts
  • src/multiplexer/dashboard-control.ts
  • src/one-shot-node-inventory.test.ts

Comment thread src/multiplexer/dashboard-control.ts

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
src/one-shot-node-inventory.test.ts (1)

14-20: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Broaden the project-restart-cli match.
/"restart",\s*"--project"/ only catches one literal array shape, so a reintroduction using different quoting or a slightly different call form could slip past this guard. Matching both tokens more structurally would make the regression check less brittle.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/one-shot-node-inventory.test.ts` around lines 14 - 20, Broaden the
`project-restart-cli` pattern in `runtimeNodeLaunchPatterns` so it matches the
`restart` and `--project` tokens more structurally instead of relying on one
exact quoted array shape. Update the regex in
`src/one-shot-node-inventory.test.ts` to tolerate different quoting and
spacing/call forms while still identifying the same restart CLI usage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/one-shot-node-inventory.test.ts`:
- Around line 14-20: Broaden the `project-restart-cli` pattern in
`runtimeNodeLaunchPatterns` so it matches the `restart` and `--project` tokens
more structurally instead of relying on one exact quoted array shape. Update the
regex in `src/one-shot-node-inventory.test.ts` to tolerate different quoting and
spacing/call forms while still identifying the same restart CLI usage.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8bb0812e-b65a-4ecc-b10d-e5e605ee21a2

📥 Commits

Reviewing files that changed from the base of the PR and between 06ac3f5 and b59d45a.

📒 Files selected for processing (5)
  • src/multiplexer/dashboard-control.test.ts
  • src/multiplexer/dashboard-control.ts
  • src/one-shot-node-inventory.test.ts
  • src/runtime-restart.test.ts
  • src/runtime-restart.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/multiplexer/dashboard-control.ts
  • src/multiplexer/dashboard-control.test.ts

@TraderSamwise

Copy link
Copy Markdown
Owner Author

Sub-agent review finding fixed in 7d5f2d3: dashboard-initiated control-plane restarts are now abortable, the dashboard timeout aborts the in-process restart, and a regression test proves the global restart lock is released even when the owner PID remains alive.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/runtime-restart.ts (1)

674-688: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Regenerate dist/ for this runtime change.

This alters restartAimuxControlPlane runtime behavior, so a source-only validation isn't sufficient—run yarn build to update dist/ before merge.

As per coding guidelines: "For aimux runtime or CLI behavior changes, run yarn build to update dist/; source-level validation with yarn vitest and yarn typecheck is not enough".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/runtime-restart.ts` around lines 674 - 688, This change updates runtime
behavior in restartAimuxControlPlane, so the compiled artifacts need to be
regenerated as well. After making the source change, run yarn build to refresh
dist/ for the affected runtime code, rather than relying only on source-level
checks; use the restartAimuxControlPlane and restartAimuxControlPlaneUnlocked
flow as the reference point when verifying the built output.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/runtime-restart.ts`:
- Around line 682-687: The restart lock is being released too early in the
restart flow, allowing a second restart to overlap while the first one is still
tearing down. In runtime-restart.ts, update the logic around
restartAimuxControlPlaneUnlocked and raceRestartWithAbort so the lock is not
released until the restart work has fully settled, either by awaiting the
restart promise itself or by adding a bounded drain after abort before calling
releaseRuntimeRestartLock.

---

Outside diff comments:
In `@src/runtime-restart.ts`:
- Around line 674-688: This change updates runtime behavior in
restartAimuxControlPlane, so the compiled artifacts need to be regenerated as
well. After making the source change, run yarn build to refresh dist/ for the
affected runtime code, rather than relying only on source-level checks; use the
restartAimuxControlPlane and restartAimuxControlPlaneUnlocked flow as the
reference point when verifying the built output.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e519ec44-2518-47e2-9920-2e0b37b03aaf

📥 Commits

Reviewing files that changed from the base of the PR and between b59d45a and 7d5f2d3.

📒 Files selected for processing (4)
  • src/multiplexer/dashboard-control.test.ts
  • src/multiplexer/dashboard-control.ts
  • src/runtime-restart.test.ts
  • src/runtime-restart.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/multiplexer/dashboard-control.ts
  • src/multiplexer/dashboard-control.test.ts

Comment thread src/runtime-restart.ts Outdated
@TraderSamwise
TraderSamwise merged commit c3621be into master Jul 3, 2026
3 checks passed
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.

1 participant