Skip to content

fix(ssh): reuse installed runtimes and pin Effect dependencies - #50

Merged
kalvenschraut merged 3 commits into
rtvisionfrom
fix/ssh-runtime-reuse-and-effect-pin
Sep 11, 2026
Merged

kalvenschraut merged 3 commits into
rtvisionfrom
fix/ssh-runtime-reuse-and-effect-pin

Conversation

@kalvenschraut

@kalvenschraut kalvenschraut commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

SSH pairing could time out while npm resolved the CLI even when the remote service already had the exact version installed. The published package also allowed npm to select a newer shared Effect dependency whose peer version was unavailable.

The SSH runner now reuses a complete installed runtime after checking its version, package identity, sentinel, and CLI entry. The server package directly pins the shared Effect dependency through the existing catalog. Explicit runner overrides and the RTVision registry fallback keep their existing behavior.

Validation: 57 focused SSH tests, scoped lint and SSH typecheck, and server dependency checks passed. Disposable npm alias and npm-exec installations retained rc.112, loaded node-pty, and passed CLI startup and service preflight. Fable 5.1 reviewed the patch; its dependency-audit, shell-portability, and documentation findings are addressed.

Implemented with GPT-6 in Codex. Reviewed with Fable 5.1 in Claude Code.

Summary by CodeRabbit

  • New Features

    • Remote CLI sessions can now reuse compatible, fully installed runtime versions, reducing unnecessary package downloads.
    • Incompatible or incomplete installations continue to use the existing package installation fallback.
  • Bug Fixes

    • Improved runtime selection to reject invalid, mismatched, outdated, or incomplete installations.
  • Documentation

    • Updated troubleshooting guidance for verifying remote CLI installations and supported runtime versions.
  • Tests

    • Added coverage for runtime reuse, fallback behavior, argument handling, and script overrides.

@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Sep 11, 2026
@kalvenschraut

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 11, 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 commented Sep 11, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 5c2bac77-decd-48c4-8820-678ed54a0767

📥 Commits

Reviewing files that changed from the base of the PR and between a76fd05 and 4004f97.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • apps/server/package.json
  • docs/user/rtvision-wsl-ssh.md
  • knip.jsonc
  • packages/ssh/src/installedRuntime.test.ts
  • packages/ssh/src/tunnel.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The SSH runner now reuses validated installed t3 runtimes before using npm. Tests cover runtime selection and fallback behavior. Server dependency metadata and SSH troubleshooting guidance are also updated.

Changes

SSH runtime selection

Layer / File(s) Summary
Installed runtime resolution
packages/ssh/src/tunnel.ts, packages/ssh/src/installedRuntime.test.ts
The runner validates installed runtime markers, package metadata, and the CLI entry point before direct execution. Tests cover matching, invalid, missing, outdated, mismatched, and overridden runtimes.
Runtime guidance
docs/user/rtvision-wsl-ssh.md
The troubleshooting entry documents installed-runtime reuse and legacy launcher verification.

Server dependency metadata

Layer / File(s) Summary
Dependency declaration and analysis configuration
apps/server/package.json, knip.jsonc
The server adds @effect/platform-node-shared and excludes it from Knip dependency warnings.

Priority: ⬇️ Low

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

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant RemoteRunner
  participant InstalledRuntime
  participant Npm
  RemoteRunner->>InstalledRuntime: Validate installed t3 runtime
  alt Runtime is valid
    InstalledRuntime-->>RemoteRunner: Return CLI entry path
    RemoteRunner->>InstalledRuntime: Execute CLI
  else Runtime is invalid or unavailable
    RemoteRunner->>Npm: Resolve and run CLI
    Npm-->>RemoteRunner: Return runnable CLI
  end
Loading

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to 4004f

The installed-runtime reuse preserves validated fallback behavior and the server dependency uses the existing catalog pin. No merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (3 skipped: 3 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes both primary changes: SSH runtime reuse and Effect dependency pinning.
Description check ✅ Passed The description clearly explains what changed, why it changed, preserved behavior, and validation results. It does not use the template headings or include the checklist, but it is otherwise complete …
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ssh-runtime-reuse-and-effect-pin

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.

❤️ Share

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

@kalvenschraut

Copy link
Copy Markdown
Member Author

@coderabbitai review

The current head is cb880eeb4. Since your review of 4004f97ce, the only changes are in the shell fixture: a scoped Effect compiler exception for the real Node filesystem/subprocess boundary, following the existing daemon-discovery fixture, and a docstring addressing the coverage warning. The production patch is unchanged. Scoped lint and the Effect compiler check pass.

Please review the current head and submit an approval if no blocking findings remain.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '=== Commits ==='
git show -s --format='%H%n%P%n%s' 4004f97ce
git show -s --format='%H%n%P%n%s' cb880eeb4

echo '=== Delta stat and names ==='
git diff --stat 4004f97ce..cb880eeb4
git diff --name-status 4004f97ce..cb880eeb4

echo '=== Delta ==='
git diff --find-renames --find-copies --unified=80 4004f97ce..cb880eeb4 -- packages/ssh/src/installedRuntime.test.ts

echo '=== Affected test file outline ==='
ast-grep outline packages/ssh/src/installedRuntime.test.ts --items all

echo '=== Existing Effect compiler exceptions in SSH tests ==='
rg -n -C 8 --glob '*test.ts' '(Effect compiler|effect compiler|filesystem|subprocess|daemon.discovery|daemon-discovery|unsafe)' packages/ssh

Length of output: 7792


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '=== Daemon-discovery fixture header ==='
sed -n '1,45p' packages/ssh/src/daemonDiscovery.test.ts

echo '=== Whitespace checks ==='
git diff --check 4004f97ce..cb880eeb4
merge_base="$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main 2>/dev/null || true)"
if [ -n "$merge_base" ]; then
  echo "merge-base: $merge_base"
  git diff --check "$merge_base"..cb880eeb4
  echo '=== Files changed from merge base ==='
  git diff --name-status "$merge_base"..cb880eeb4
else
  echo 'No local main reference available; merge-base comparison skipped.'
fi

echo '=== Commits since previously reviewed commit ==='
git log --oneline --no-decorate 4004f97ce..cb880eeb4

Length of output: 16468


@kalvenschraut I reviewed the changes from 4004f97ce through cb880eeb4.

The delta only changes packages/ssh/src/installedRuntime.test.ts. The file-scoped Effect diagnostic exception matches packages/ssh/src/daemonDiscovery.test.ts and is limited to the real Node filesystem and subprocess fixture. The added docstring is accurate. The whitespace check passed.

I found no blocking issues. Approving PR #50.

✅ Action performed

Comments resolved and changes approved.

@kalvenschraut

Copy link
Copy Markdown
Member Author

@coderabbitai Please confirm whether you approve the current head cb880ee and submit an APPROVED review if no blockers remain. The only changes after your completed review are the test fixture compiler annotation and the docstring that addresses your warning.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

@kalvenschraut I confirm approval of the current head, cb880eeb4.

The scoped compiler annotation and the docstring do not introduce blockers. PR #50 is approved.

✅ Action performed

Comments resolved and changes approved.

@github-actions

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.6 KiB 13.6 KiB +5 B (+0.0%) 15.1 KiB ✅
Codex Thread snapshot wire 7.0 KiB 7.0 KiB +1 B (+0.0%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.6 KiB 6.6 KiB +4 B (+0.1%) 7.8 KiB ✅
Codex Live turn WebSocket decoded 57.1 KiB 57.1 KiB 0 B (0.0%) 66.4 KiB ✅
Codex Live turn messages 10 10 0 (0.0%) 21 ✅
Claude Total thread wire 13.6 KiB 13.6 KiB +47 B (+0.3%) 15.1 KiB ✅
Claude Thread snapshot wire 7.0 KiB 7.1 KiB +6 B (+0.1%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.5 KiB 6.5 KiB +41 B (+0.6%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 57.8 KiB 57.9 KiB +88 B (+0.1%) 66.4 KiB ✅
Claude Live turn messages 8 10 +2 (+25.0%) 21 ✅

Baseline: a76fd05 · PR result: cb880ee · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.9 KiB
  • Claude decoded thread snapshot: 114.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@kalvenschraut
kalvenschraut merged commit 4f3898d into rtvision Sep 11, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant