Skip to content

fix(test): stabilize system SSH transport integration - #11597

Merged
brennanb2025 merged 4 commits into
mainfrom
brennanb2025/bullhead
Jul 30, 2026
Merged

brennanb2025 merged 4 commits into
mainfrom
brennanb2025/bullhead

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Keep the preinstalled system SSH relay fixture aligned with the current required-artifact and native-module health probes.
  • Prevent the integration test from silently running a real npm install and close the fake detached relay after its readiness probe.
  • Assert that the warm-install scenario never enters relay upload or native dependency installation.
  • Extract the mobile terminal display-mode predicate so current main remains below its max-lines ratchet without a disable or limit increase.

Screenshots

No visual change.

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed

Focused verification:

  • pnpm exec oxlint --format default — 0 warnings, 0 errors across 11,025 files
  • pnpm run check:max-lines-ratchet
  • pnpm run typecheck:node
  • SSH integration: 10 consecutive focused runs, 30/30 tests passed, with no leaked fake relay process
  • Mobile route helper: focused tests, typecheck, lint, and format checks passed

The full pnpm test run passed the SSH transport integration file and completed 41,639 tests successfully. It reported four failures outside this change: two environment-sensitive assertions in agent-exec-handler.test.ts and two timeouts in pty-subprocess.test.ts.

AI Review Report

Reviewed the fixture against the current relay install and native dependency probe contracts. The review found that the fixture lacked relay-watcher.js and a working node-pty/lib/utils probe stub, so the intended warm-install test performed a real upload and npm install. It also found that the fake detached relay stayed alive for 20 seconds after the test. Both issues are fixed, and progress assertions now guard the warm path.

The initial CI run also exposed an unrelated max-lines regression already present on current main. The terminal display-mode predicate was moved into the existing session route domain module with focused tests; behavior and styling are unchanged.

Cross-platform review covered macOS, Linux, and Windows. The SSH fixture remains explicitly POSIX-only and skipped on Windows; added paths use node:path, no production shortcuts or labels changed, no Electron behavior changed, and no production SSH shell behavior changed. The mobile extraction preserves the existing display-mode behavior on every platform.

Security Audit

The SSH change has no production input, auth, IPC, or dependency changes. Reviewed temporary path handling, fake shell execution, process cleanup, and dependency behavior. All commands operate on test-generated paths, and the change removes the test's unintended external package installation. The mobile follow-up is a pure predicate extraction with no new input or side effects.

Notes

The local full-suite run used Node 26 while the repository declares Node 24. No production SSH behavior changed.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 86705b13-5a17-4056-ba0f-1e3374650f7f

📥 Commits

Reviewing files that changed from the base of the PR and between fbf6375 and 14f56c9.

📒 Files selected for processing (1)
  • src/main/ssh/ssh-system-transport.integration.test.ts

📝 Walkthrough

Walkthrough

The SSH integration fixture adds relay runtime stubs, expands the remote node-pty layout, changes detached relay shutdown, and adds deployment progress assertions. Mobile session routing now uses a shared helper to determine terminal phone-display mode, with tests covering supported terminal modes and null handles.

🚥 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%. 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 is concise and matches the main SSH transport integration stabilization work in the PR.
Description check ✅ Passed The description includes all required template sections and provides specific testing, review, and security notes.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3d848856-8b65-4c16-aedc-3bd96d30f7e4

📥 Commits

Reviewing files that changed from the base of the PR and between 8ea8fe1 and db96379.

📒 Files selected for processing (1)
  • src/main/ssh/ssh-system-transport.integration.test.ts

@greptile-apps

greptile-apps Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR fixes three pre-existing bugs in the SSH system-transport integration test fixture and extracts a display-mode predicate to keep the session screen file under its max-lines ratchet. No production behavior changes.

  • SSH fixture corrections: adds the missing relay-watcher.js and managed-hook-runtime.js artifact stubs (so the warm-install check passes and no real npm install is triggered), adds a node-pty/lib/utils.js stub matching the native-deps health probe, rewrites the fake relay's --detached path to close after the first handshake instead of leaking for 20 s, and replaces the duplicated protocol parser in --connect with a clean socket pipe-through. New progress assertions verify that the warm path skips upload and native-dep install.
  • Mobile predicate extraction: isTerminalPhoneDisplayMode is moved from an inline closure in [worktreeId].tsx into mobile-session-route-helpers.ts with a ReadonlyMap signature, three call sites updated, and a dedicated test file added covering all five branches.

Confidence Score: 5/5

Safe to merge — all changes are test-fixture corrections and a mechanical predicate extraction with no production code path affected.

Every production call site for the extracted predicate is a direct mechanical replacement with identical logic; the SSH changes touch only the test fixture and add well-targeted progress assertions that match the exact strings emitted by the production deploy function.

Files Needing Attention: No files require special attention.

Important Files Changed

Filename Overview
src/main/ssh/ssh-system-transport.integration.test.ts Three bugs fixed: missing relay-watcher.js/managed-hook-runtime.js artifacts in the fixture (causing a real npm install), a 20-second leaked fake relay process, and a duplicated protocol parser in the --connect path replaced with a clean socket proxy. Progress assertions now guard the warm-install path.
mobile/src/session/mobile-session-route-helpers.ts Adds isTerminalPhoneDisplayMode predicate extracted from the large session screen component. Logic is identical to the removed inline function; signature widens the map to ReadonlyMap and is fully compatible with the Map<string, MobileDisplayMode> state.
mobile/src/session/mobile-session-route-helpers.test.ts New test file covering all five branches of isTerminalPhoneDisplayMode (auto, phone, missing handle, null, desktop). Coverage is complete.
mobile/app/h/[hostId]/session/[worktreeId].tsx Removes the inline isPhoneMode closure and replaces three call sites with the extracted isTerminalPhoneDisplayMode. Change is mechanical and behaviorally identical.

Reviews (3): Last reviewed commit: "fix(test): exercise fake relay socket br..." | Re-trigger Greptile

@brennanb2025
brennanb2025 merged commit 53430e3 into main Jul 30, 2026
42 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* fix(test): stabilize system SSH transport integration

* fix(lint): extract terminal display mode predicate

* fix(test): exercise fake relay socket bridge
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