Skip to content

fix(ssh): a password SSH host waits for you at launch instead of prompting - #30025

Merged
nwparker merged 3 commits into
mainfrom
nwparker/ssh-sign-in-not-at-launch
Oct 17, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/ssh-sign-in-not-at-launch

Conversation

@nwparker

@nwparker nwparker commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​245 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​244
Prod 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​111 $\color{#cf222e}{\Huge{\mathbf{−}}}$​13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​98

ELI5

If you sign in to an SSH host with a password, Orca forgets that password when it quits (it always has). Since the move to managed servers, Orca also tries to reach that host the moment it starts, so the password dialog pops up at launch, before you've touched anything. Now Orca remembers that the host needs a password and waits: the host shows as disconnected, and you get the password dialog only when you choose Connect.

What Changed

Before (1.4.229): a password (or passphrase, or keyboard-interactive) SSH host opens a blocking "SSH Password" dialog every time Orca starts, with no workspace opened. Users updating from 1.4.227 relay hosts had never seen this. 1.4.227 deferred those hosts to tab focus.

After: at launch the host shows as Disconnected in the status bar's Remote Hosts menu, and an open workspace on it shows a calm amber note: "pwhost needs you to sign in. Reconnect to sign in." Nothing is dialed and no dialog opens until you choose Connect (status bar, Settings, or the workspace's reconnect). Then you get the dialog once, and everything reattaches.

Mechanism:

  • 1.4.227 recorded lastRequiredPassphrase on the SSH target after a sign-in that asked for any typed credential. Startup restore used it to defer those hosts to tab focus. The relay removal (refactor(ssh): connect fails for hosts orcad can't serve; remove the relay client path #27214) deleted that write, so new hosts never got the flag. Managed-server status checks and tunnels (runtime-environment-status-owner → ensureOrcadManagedTunnel → SshConnectionManager.connect) never consulted it anyway. This PR writes the flag again from the one place every transport reports connected (handleSshConnectionStateChange). It's set when a credential was asked for or a remembered one was replayed, and cleared when the host signed in with neither.
  • When the main process first creates the connection manager, every host with the flag is marked "awaiting sign-in". This reuses the existing cancelled-sign-in gate from fix(ssh): Cancel on an SSH password prompt no longer brings it straight back #28402: background dials refuse as an auth failure without touching the network, and automatic credential requests answer "cancelled". Every explicit connect already lifts that gate (ssh:connect without automatic, runtimeEnvironments:connect, test connection, or a sign-in that succeeds anyway). A window re-registration doesn't re-mark hosts the user already signed in to.
  • The refusal message now says the host needs a sign-in rather than "was cancelled". The terminal toast recognises both messages as an SSH state: amber, no IPC wrapper, no "file an issue" link.

Nothing is stored. Passwords stay in memory only, exactly as in 1.4.227. Nothing new crosses the wire.

Why

  • Prompting from a background check is the regression. The user hasn't asked for that host yet, and a modal at launch is abrupt. Gating background dials, rather than suppressing the dialog in the renderer, also stops the auth attempts from reaching the host at all, so there's no MaxAuthTries or fail2ban noise.
  • Reusing the fix(ssh): Cancel on an SSH password prompt no longer brings it straight back #28402 decline gate means one "only an explicit connect may ask" rule, with the explicit paths already wired, instead of a parallel mechanism.
  • Remembering passwords (Electron safeStorage) would remove the prompt entirely, but 1.4.227 never stored them. That's a new feature, so it's held for a separate decision.
  • Limit: a host whose last sign-in happened on a version that didn't write the flag (a 1.4.227 managed host, or any host first connected on 1.4.228/229) still prompts once on its first launch with this build. After that sign-in the flag is set, and later launches wait. Relay-era 1.4.227 hosts already carry the flag, so they never prompt at launch.

Linked Issue

Internal regression report (coworker updating 1.4.227 → 1.4.229). No GitHub issue.

Visual Proof

Same isolated profile, same password-only SSH host, a workspace with a remote terminal open at quit, relaunch:

1.4.229 (packaged), flag already set This branch
shot-229-flagged-startup.png shot-b-run4-startup.png

Testing

Live, on macOS (this Mac), fully isolated (ORCA_BACKGROUND_LAUNCH=1, throwaway HOME/userData under /tmp, no windows shown). The host was a user-level sshd with HOME redirected to /tmp, fronted by an ssh2 proxy that accepts only password / keyboard-interactive auth, and logs every auth attempt.

  • Packaged 1.4.227: added a password host, connected (a managed server was deployed), then quit and relaunched. The password dialog opened at launch (227's managed route also never wrote the flag).

  • Packaged 1.4.229 on the upgraded profile: the password dialog opened at launch. It did the same with lastRequiredPassphrase: true already persisted, which is the relay-era coworker state.

  • This branch, same upgraded profile:

    • First launch prompted once (the flag was missing). I answered it, and the flag persisted true.
    • Every later launch, with and without a workspace and remote terminal open: no dialog and zero auth attempts at the proxy. The status bar showed pwhost Disconnected / Connect, and the workspace showed the amber "needs you to sign in" note.
    • Choosing Connect in the status bar opened the dialog. After the password, the host was Connected and the workspace's terminal and files came back.
  • Unit tests that fail before this change: src/main/ipc/ssh-sign-in-requirement.test.ts (launch gating, explicit connect lifts it, re-registration, flag set/replayed/cleared). Also added: a manager refusal case in ssh-connection-manager.test.ts, and the toast in terminal-ssh-sign-in-error.test.ts. Ran src/main/ipc/ssh*, src/main/ssh/ssh-connection*, src/main/ssh/ssh-credential* and src/renderer/src/components/terminal-pane: 579 files, all pass.

  • pnpm lint (full, including the ratchets), pnpm tc, and check:code-quality:changed all pass. Codex review: clean after one P2 (a test fixture) was fixed.

  • Not verified live: Linux and Windows hosts. The change is desktop-main logic with no platform branches.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Security: no credential is stored or sent anywhere. The change only decides when the existing in-memory prompt may open. SSH: remote hosts are reached exactly as before once the user connects. No wire or host-published content changed. Mobile: unaffected.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

nwparker and others added 3 commits October 17, 2026 01:00
…nstead of prompting

Restores the persisted 'last sign-in needed a typed credential' flag that
the relay removal (#27214) stopped writing, and at launch marks those hosts
as awaiting sign-in so background reconnects (startup restore, managed-server
status checks and tunnels) refuse without dialing instead of opening the
password dialog. The user's own Connect lifts it and prompts. The terminal
toast shows the refusal as an SSH state, not a bug to report.

Co-Authored-By: Claude <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c3196861-ec1e-437e-af03-35f58cb05212
📥 Commits

Reviewing files that changed from the base of the PR and between 3813104 and c07a88d.

📒 Files selected for processing: 12
  • src/main/ipc/ssh-connection-state-callbacks.ts
  • src/main/ipc/ssh-sign-in-requirement.test.ts
  • src/main/ipc/ssh-sign-in-requirement.ts
  • src/main/ipc/ssh.test.ts
  • src/main/ipc/ssh.ts
  • src/main/ssh/ssh-connection-manager.test.ts
  • src/main/ssh/ssh-connection-manager.ts
  • src/main/ssh/ssh-credential-decline.ts
  • src/renderer/src/components/terminal-pane/TerminalErrorToast.tsx
  • src/renderer/src/components/terminal-pane/terminal-ssh-sign-in-error.test.ts
  • src/renderer/src/components/terminal-pane/terminal-ssh-sign-in-error.ts
  • src/shared/ssh-sign-in-required-copy.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

📝 Walkthrough

The SSH connection flow now records whether a target required a passphrase and marks eligible targets as awaiting sign-in when a new connection manager is created. Credential-decline errors distinguish awaited sign-in from cancellation. Terminal error handling recognizes these sign-in messages and applies SSH-specific formatting and display behavior. Tests cover credential requests, cached credentials, connection errors, and terminal toasts.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to c07a8

Password SSH hosts now wait for an explicit Connect at launch instead of prompting in the background. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 12 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: password-based SSH hosts wait for an explicit connection instead of prompting during launch.
Description check Passed The description is detailed and covers the user impact, implementation, rationale, testing, visual proof, security, compatibility, and checklist items. It notes that no GitHub issue exists, which is a…
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: Description check

Explanation

The description is detailed and covers the user impact, implementation, rationale, testing, visual proof, security, compatibility, and checklist items. It notes that no GitHub issue exists, which is acceptable if the contributor is an internal maintainer under the template’s special case.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@nwparker
nwparker merged commit 98d8257 into main Oct 17, 2026
38 checks passed
nwparker added a commit to JadenMeister/orca that referenced this pull request Nov 30, 2026
…e composer

The Run on picker's Connect button called the passive
runtimeEnvironments.getStatus for Orca-server hosts. Since stablyai#30025 a
password SSH host waits at launch for an explicit connect, and only the
connect handler lifts that sign-in gate, so the button showed "needs you
to sign in" and never opened the password dialog.

Call runtimeEnvironments.connect instead, keeping the 15 s wait and the
host's real error toast.

Fixes stablyai#52882

Co-authored-by: Neil <[email protected]>
nwparker added a commit that referenced this pull request Nov 30, 2026
…e composer (#52903)

The Run on picker's Connect button called the passive
runtimeEnvironments.getStatus for Orca-server hosts. Since #30025 a
password SSH host waits at launch for an explicit connect, and only the
connect handler lifts that sign-in gate, so the button showed "needs you
to sign in" and never opened the password dialog.

Call runtimeEnvironments.connect instead, keeping the 15 s wait and the
host's real error toast.

Fixes #52882

Co-authored-by: Neil <[email protected]>
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