Skip to content

feat: Windows host access (1.4.0 batch) - #57

Merged
involvex merged 1 commit into
mainfrom
cursor/windows-host-access-1.4
Nov 16, 2026
Merged

involvex merged 1 commit into
mainfrom
cursor/windows-host-access-1.4

Conversation

@involvex

@involvex involvex commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add SSH keyboard-interactive auth (2FA/TOTP) with a secure prompt dialog.
  • Opt-in OpenCode agent tunnel over SSH local forward to remote 127.0.0.1:agentPort.
  • Import OpenSSH ~/.ssh/config from the connected host; profile search, favorites, and duplicate.

Related issues

N/A — 1.4.0 host-access feature batch.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing behavior to change)
  • Documentation update
  • CI / tooling only

Platform tested

  • Android
  • Windows
  • Linux
  • macOS
  • iOS
  • Not applicable (docs/CI only)

Test plan

  • flutter pub get
  • flutter analyze (no errors)
  • flutter test
  • Manual testing on device/emulator

Steps:

  1. Run flutter test test/utils/ssh_config_parser_test.dart test/services/ssh_config_import_service_test.dart test/services/ssh_local_forward_test.dart test/widgets/keyboard_interactive_dialog_test.dart test/models/ssh_profile_agent_auth_test.dart
  2. Connect to a Windows OpenSSH host that requires keyboard-interactive / TOTP and confirm the prompt dialog.
  3. Enable Tunnel agent over SSH on a profile whose OpenCode listens on loopback; connect Agents and verify chat works.
  4. From an active Client session, import ~/.ssh/config in Profile Manager; search, pin, and duplicate a profile.

Screenshots / recordings

N/A — auth dialog and profile manager polish; manual screenshots optional after device test.

Checklist

  • My code follows the project style in analysis_options.yaml
  • I did not commit secrets, credentials, or private keys
  • I updated documentation if user-facing behavior changed
  • I added or updated tests where appropriate

Summary by Sourcery

Expand Windows and OpenSSH host access with interactive authentication, agent tunneling, configuration import, and improved profile management.

New Features:

  • Add keyboard-interactive SSH authentication with secure 2FA/TOTP prompts.
  • Enable optional SSH tunneling for OpenCode agents bound to the remote host loopback.
  • Import supported OpenSSH host profiles from a connected host.
  • Add profile search, favorites, and duplication.

Enhancements:

  • Persist new profile options with backward-compatible defaults and preserve existing credentials during imports.

Documentation:

  • Document keyboard-interactive authentication, profile management, SSH config import, and agent tunneling.

Tests:

  • Add coverage for SSH config parsing and profile merging, local forwarding lifecycle, profile persistence, and keyboard-interactive dialog behavior.

Chores:

  • Update the changelog and feature roadmap to reflect the shipped host-access capabilities and remaining limitations.

…config import

Add keyboard-interactive auth, optional OpenCode SSH local forward, and OpenSSH config import with profile search/favorites/duplicate for the 1.4.0 host-access batch.

Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot

changeset-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 641abd9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sourcery-ai

sourcery-ai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Reviewer's Guide

Data structures

Add persisted profile options for agent tunneling and favorites, including backward-compatible defaults and serialization.

  • lib/models/ssh_profile.dart L25-31 (+5 small edits)

Attach the active SSH forward to agent connections so its lifecycle can be cleaned up with the connection.

  • lib/models/agent_connection.dart L81-84 (+3 small edits)

API

Expose SSH keyboard-interactive prompt handling and connected-session lookup, and wire keyboard-interactive authentication into SSH connection setup.

  • lib/providers/ssh_provider.dart L138-142, L302-312, L347-364 (+1 small edits)

Add the local-forward service interface for binding loopback and forwarding accepted sockets through SSH.

  • lib/services/ssh_local_forward.dart L1-144

Add parsing and import interfaces for reading remote OpenSSH config and merging entries into profiles.

  • lib/services/ssh_config_import_service.dart L1-131
  • lib/utils/ssh_config_parser.dart L1-207

Uses of the API

Pass the shared SSH provider to the agent provider so tunnel-enabled profiles can reuse SSH sessions.

  • lib/main.dart L36

Prepare an SSH local forward for tunnel-enabled profiles and retain or close it as agent connections succeed or fail.

  • lib/providers/agent_provider.dart L11-15, L58-68, L113-155 (+4 small edits)

Connect keyboard-interactive SSH prompts to the secure dialog from the home screen.

  • lib/screens/home_screen.dart L15, L108-113

UI

Add the keyboard-interactive prompt dialog, masking non-echo responses and returning answers or cancellation.

  • lib/widgets/keyboard_interactive_dialog.dart L1-112

Add profile search, favorite sorting and pinning, config import, duplication, and controls for the new profile options.

  • lib/widgets/profile_manager.dart L19-48, L125-161, L204-301 (+9 small edits)

Documentation

Document keyboard-interactive authentication, profile management, SSH config import, and the optional agent tunnel.

  • CHANGELOG.md L10-15
  • docs/features.md L5-9, L29-32
  • suggestions.md L121-124 (+4 small edits)

Tests

Test profile option persistence, SSH config parsing and merging, local-forward lifecycle, and keyboard-interactive dialog behavior.

  • test/models/ssh_profile_agent_auth_test.dart L80-103
  • test/services/ssh_config_import_service_test.dart L1-52
  • test/services/ssh_local_forward_test.dart L1-34
  • test/utils/ssh_config_parser_test.dart L1-71
  • test/widgets/keyboard_interactive_dialog_test.dart L1-93

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@involvex
involvex marked this pull request as ready for review November 16, 2026 05:00
@sourcery-ai

sourcery-ai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Sorry @involvex, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 6 days and 7 hours by commenting @sourcery-ai review. Upgrade to get a review now.

autofocus: i == 0,
obscureText: !request.prompts[i].echo,
decoration: InputDecoration(
labelText: request.prompts[i].promptText.trim().isEmpty

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CRITICAL: SSHUserInfoPrompt has no promptText field — this will not compile

In dartssh2, SSHUserInfoPrompt exposes the prompt string as prompt (constructor is SSHUserInfoPrompt(prompt, echo)). request.prompts[i].promptText is an undefined getter, so this file fails to compile and the widget test that imports it cannot run. Use request.prompts[i].prompt.

}

void _duplicateProfile(BuildContext context, SSHProfile profile) {
final copy = SSHProfile(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Duplicating a profile silently drops isServer

_duplicateProfile rebuilds SSHProfile field-by-field but never passes isServer, so it defaults to false. Duplicating a server profile silently turns the copy into a client profile, which changes behavior in share/widget flows that filter on !p.isServer. Also pass isServer: profile.isServer.

socket.destroy();
return;
}
_localSockets.add(socket);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Per-connection sockets/channels are never removed from the tracking lists

_localSockets (line 90) and _channels (line 94) only ever grow: entries are added here but the onDone/onError handlers destroy the socket/channel without pruning them from these lists. For a long-lived agent tunnel serving many HTTP connections, both lists grow without bound until close(). Remove each socket/channel when its stream completes, or prune closed entries.

fallbackUsername: session.profile.username,
);

for (final profile in merged.profiles) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SUGGESTION: Re-saving every merged profile is O(n²) I/O

merged.profiles contains the existing profiles plus the new ones, and this loop calls saveProfile (which writes secure storage, rewrites the full profile list, and notifies listeners) once per profile. For a large ~/.ssh/config that is many redundant disk writes and UI rebuilds. Save only the created/updated profiles, or add a batch-save path.

@kilo-code-bot

kilo-code-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 2
SUGGESTION 1
Issue Details (click to expand)

CRITICAL

File Line Issue
lib/widgets/keyboard_interactive_dialog.dart 87 SSHUserInfoPrompt has no promptText field (it is prompt); this will not compile and the widget test importing it cannot run.

WARNING

File Line Issue
lib/widgets/profile_manager.dart 282 _duplicateProfile rebuilds SSHProfile without isServer, so duplicating a server profile silently converts the copy into a client profile.
lib/services/ssh_local_forward.dart 90 Per-connection sockets/channels are added to _localSockets/_channels but never pruned when connections close; lists grow unbounded for long-lived tunnels.

SUGGESTION

File Line Issue
lib/widgets/profile_manager.dart 243 Import re-saves every merged profile (including unchanged existing ones), causing O(n²) secure-storage/config writes and repeated listener notifications.
Files Reviewed (19 files)
  • CHANGELOG.md - 0 issues
  • docs/features.md - 0 issues
  • lib/main.dart - 0 issues
  • lib/models/agent_connection.dart - 0 issues
  • lib/models/ssh_profile.dart - 0 issues
  • lib/providers/agent_provider.dart - 0 issues
  • lib/providers/ssh_provider.dart - 0 issues
  • lib/screens/home_screen.dart - 0 issues
  • lib/services/ssh_config_import_service.dart - 0 issues
  • lib/services/ssh_local_forward.dart - 1 issue
  • lib/utils/ssh_config_parser.dart - 0 issues
  • lib/widgets/keyboard_interactive_dialog.dart - 1 issue
  • lib/widgets/profile_manager.dart - 2 issues
  • suggestions.md - 0 issues
  • test/models/ssh_profile_agent_auth_test.dart - 0 issues
  • test/services/ssh_config_import_service_test.dart - 0 issues
  • test/services/ssh_local_forward_test.dart - 0 issues
  • test/utils/ssh_config_parser_test.dart - 0 issues
  • test/widgets/keyboard_interactive_dialog_test.dart - 0 issues

Fix these issues in Kilo Cloud


Reviewed by free · Input: 142.4K · Output: 63.4K · Cached: 2.4M

@involvex
involvex merged commit 9a73bc4 into main Nov 16, 2026
8 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