Skip to content

Fast-path remote core commands - #304

Merged
TraderSamwise merged 2 commits into
masterfrom
chore/core-sidecar-next-29
Jul 4, 2026
Merged

Fast-path remote core commands#304
TraderSamwise merged 2 commits into
masterfrom
chore/core-sidecar-next-29

Conversation

@TraderSamwise

@TraderSamwise TraderSamwise commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • add daemon-owned text routes for remote status/enable/disable
  • route installed shim remote commands through the matching daemon without spawning Node
  • keep remote status JSON token-free and move the core-routable backlog to empty

Verification

  • yarn vitest run src/core-cli.test.ts src/daemon.test.ts src/installed-shim.test.ts src/core-command-ownership.test.ts
  • yarn typecheck && yarn lint && yarn build && yarn vitest run
  • pre-push: yarn typecheck && yarn lint && yarn test

Summary by CodeRabbit

  • New Features

    • Added support for remote status, enable, and disable actions through the installed command path.
    • Remote status now shows clearer connection and login state, with JSON output still available.
  • Bug Fixes

    • Remote enable/disable flows now return more consistent messages and exit behavior.
    • Remote status and related responses no longer expose sensitive relay details.

@vercel

vercel Bot commented Jul 4, 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 4, 2026 2:31pm

@coderabbitai

coderabbitai Bot commented Jul 4, 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: 46 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: b0076946-a1ba-4355-a270-b90c8be02cb3

📥 Commits

Reviewing files that changed from the base of the PR and between 6fbd9db and 14b4a92.

📒 Files selected for processing (1)
  • scripts/installed-aimux-shim.sh
📝 Walkthrough

Walkthrough

Adds daemon HTTP text routes (remoteStatusText, remoteEnableText, remoteDisableText) with corresponding rendering helpers in core-text.ts, wires core-cli.ts to use them, extends CORE_API_ROUTES, adds shim script fast paths for remote status/enable/disable, and updates ownership docs/tests plus daemon and shim tests.

Changes

Remote access shim fast paths

Layer / File(s) Summary
Route contract and text rendering helpers
src/core-command-contract.ts, src/core-text.ts
Adds remoteStatusText/remoteEnableText/remoteDisableText routes and CoreRemoteStatusTextPayload type plus renderCoreRemoteStatusLines, renderCoreRemoteEnableLines, renderCoreRemoteDisableLines.
Daemon route handlers
src/daemon.ts, src/daemon.test.ts
Adds remoteStatusTextPayload() builder and routeRequest handlers for the three text routes, with tests covering status/enable/disable including 401 and token-leak checks.
Core CLI rendering integration
src/core-cli.ts
Replaces manual string output in runRemoteStatus, remote enable, and remote disable with the new render helpers; removes relayLastError.
Installed shim fast paths
scripts/installed-aimux-shim.sh, src/installed-shim.test.ts
Adds aimux_post_text_route helper and remote status/enable/disable dispatcher cases; updates test fixture and adds new fast-path/fallback tests.
Ownership docs and inventory tests
docs/command-ownership-inventory.md, src/core-command-ownership.test.ts
Reclassifies remote commands as CUT/shim-fast-path and updates related counts/backlog assertions.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Shim as Installed Shim
  participant Daemon
  participant Credentials
  participant Relay

  Shim->>Daemon: POST remote enable
  Daemon->>Credentials: check stored credentials
  alt no credentials
    Daemon-->>Shim: 401 Not logged in
  else credentials present
    Daemon->>Relay: enable & connect
    Relay-->>Daemon: relay status
    Daemon-->>Shim: rendered enable confirmation
  end

  Shim->>Daemon: GET remote status [--json]
  Daemon->>Credentials: read stored credentials
  Daemon->>Relay: get relay status
  Daemon-->>Shim: rendered status lines / JSON
Loading

Possibly related PRs

  • TraderSamwise/aimux#285: Both PRs change the core CLI's remote status/enable/disable implementation in src/core-cli.ts.
  • TraderSamwise/aimux#298: Extends scripts/installed-aimux-shim.sh's CLI dispatcher, building on the installed-shim infrastructure introduced there.
  • TraderSamwise/aimux#271: Both PRs extend CORE_API_ROUTES and modify src/daemon.ts's routeRequest dispatch logic with new route handlers.
🚥 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 is concise and accurately reflects the main change: moving remote core commands onto a fast path.
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 chore/core-sidecar-next-29

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

@TraderSamwise

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 4, 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

🤖 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 `@scripts/installed-aimux-shim.sh`:
- Around line 101-129: aimux_post_text_route is leaking its temp response file
because it has no interrupt-safe cleanup. Update this function to mirror the
cleanup pattern used in aimux_try_restart by adding trap handling for
EXIT/INT/TERM around the mktemp-created body_file, and make sure the trap always
removes that file even if curl or the shell is interrupted before the normal rm
calls run.
🪄 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: a5087872-8d78-4893-a44b-c6d2951ec45b

📥 Commits

Reviewing files that changed from the base of the PR and between bd229ec and 6fbd9db.

📒 Files selected for processing (9)
  • docs/command-ownership-inventory.md
  • scripts/installed-aimux-shim.sh
  • src/core-cli.ts
  • src/core-command-contract.ts
  • src/core-command-ownership.test.ts
  • src/core-text.ts
  • src/daemon.test.ts
  • src/daemon.ts
  • src/installed-shim.test.ts

Comment thread scripts/installed-aimux-shim.sh
@TraderSamwise

Copy link
Copy Markdown
Owner Author

Resolved CodeRabbit's temp-file cleanup finding in 14b4a92: the remote POST fast-path helper now removes its response temp file through EXIT/INT/TERM traps and clears those traps on each normal return path.

@TraderSamwise
TraderSamwise merged commit fe9c27a into master Jul 4, 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