Skip to content

feat: add SSH remote workspace support#206

Merged
bobleer merged 5 commits intoGCWing:mainfrom
bobleer:main
Mar 20, 2026
Merged

feat: add SSH remote workspace support#206
bobleer merged 5 commits intoGCWing:mainfrom
bobleer:main

Conversation

@bobleer
Copy link
Collaborator

@bobleer bobleer commented Mar 20, 2026

Summary

  • SSH connection management — saved connections with private key, SSH agent, and password authentication; connection tested before save
  • Remote file system via SFTP — read, write, edit, delete, rename; all agentic tools (file read/write/edit, bash, glob, grep) routed through SSH when the active workspace is remote
  • Remote terminal sessions — full PTY over SSH, integrated into the existing terminal panel
  • Multi-workspace registry — replaced single global RemoteWorkspaceState with a path-keyed HashMap, allowing multiple concurrent remote workspaces without path conflicts
  • Per-workspace connection status indicator — colored dot (green/amber/red) next to the hostname in the sidebar; pulses while reconnecting
  • Auto-reconnect on startup — retries up to 5 times with 10 s intervals; workspace stays visible in the sidebar with an error state if all retries fail
  • Session list timing fixflowChatStore.initializeFromDisk() is re-invoked after SSH reconnect completes, fixing a race where the session list loaded before the workspace was registered in the state manager
  • Snapshot/rollback graceful no-op for remote workspaces — rollback commands return an empty success instead of "Workspace directory does not exist"; snapshot recording in the agentic tool pipeline is bypassed for remote paths

Test plan

  • Connect to a remote server via SSH (key auth and agent auth)
  • Open a remote directory; verify file tree loads correctly
  • Edit/create/delete files via the agent; verify changes appear on the remote server
  • Open a remote terminal and run commands
  • Open two remote workspaces simultaneously; verify each shows correct file tree
  • Restart the app; verify both remote workspaces restore with correct status dots
  • Verify that rollback does not error on a remote workspace session
  • Verify that local workspaces are unaffected by all of the above

🤖 Generated with Claude Code

bowen628 and others added 5 commits March 21, 2026 00:14
- SSH connection management with saved connections, key/agent/password auth
- Remote file system access via SFTP (read, write, edit, delete, rename)
- Remote terminal sessions over SSH PTY
- Multi-workspace registry: path-keyed HashMap replaces single global state,
  allowing multiple concurrent remote workspaces without path conflicts
- Per-workspace connection status indicator (green/yellow/red dot) in sidebar
- Auto-reconnect on startup: retries up to 5 times with 10s intervals,
  keeps workspace in sidebar with error state if reconnection fails
- Session list re-initialized after SSH reconnect to fix timing race where
  sessions loaded before workspace was registered in state manager
- Snapshot/rollback skipped for remote workspaces (no local .bitfun dir);
  rollback commands return empty success instead of "directory not found" error
- Agentic tools (file read/write/edit, bash, glob, grep) routed through SSH
  when workspace path matches a registered remote workspace

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
russh-keys uses the openssl crate which requires a system OpenSSL
installation. On Windows runners there is none, so the build fails.
Adding openssl with the vendored feature compiles OpenSSL from source
(same approach already used by git2 via vendored-openssl).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ows build

- Make HandlerError carry actual error message (was unit struct, discarding all info)
- Implement disconnected() callback to capture real SSH disconnect reason
- Add DH_G14_SHA1/DH_G1_SHA1 KEX and SSH_RSA host key for legacy server compatibility
- Improve error message when server closes connection before sending SSH banner
- Fix win32job missing from bitfun-core Windows target dependencies
- Fix type annotation needed for MutexGuard in process_manager.rs
- Fix RemoteFileBrowser cancel button using missing i18n key (common.cancel → actions.cancel)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…howing error

Password-auth workspaces cannot auto-reconnect (BitFun does not persist passwords).
Any workspace that fails reconnection (password, key, or agent) is now silently
removed from the sidebar instead of being shown with a permanent red error state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…on startup

Before initializing FlowChatManager, check that a remote workspace's SSH
connection is actually live. If not (e.g. password-auth workspace that cannot
auto-reconnect), log a warning and skip initialization instead of showing an
error notification to the user.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bobleer bobleer merged commit 8ca1453 into GCWing:main Mar 20, 2026
4 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