DeepSeek-Reasonix icon indicating copy to clipboard operation
DeepSeek-Reasonix copied to clipboard

Remove Remote Workbench and simplify SSH remote access / 移除 Remote Workbench 并简化 SSH 远程访问

Open SivanCola opened this issue 4 months ago • 0 comments

Summary

  • Remove the Remote Workbench protocol, projection, Broker, and rpcwire stacks (about 36k lines), including the Desktop trust/projection UI and generated protocol bindings.
  • Reuse the CLI/Serve remote model: Desktop starts reasonix serve through SSH, forwards it to loopback, and opens a per-host native web child window.
  • Converge the Desktop UX on Open Remote Web, clarify that remote models, API keys, and sessions belong to the remote Reasonix installation, and add guarded cleanup for legacy Workbench data.
  • Keep a keyless remote Serve reachable: when the selected remote Provider is missing its API key, the authenticated remote window shows a loopback-only setup page, stores the key on that host, rebuilds the Controller in process, and opens the normal Serve UI.

Design and safety

  • Fresh SSH hosts default to ~, resolved by the remote bootstrap as the authenticated login user home; / is not used as a project-wide default.
  • The child-window launch token is carried in a 0600 one-shot ticket with a strict two-minute TTL; argv contains only the ticket name and a host digest.
  • Per-host single-instance handoff reuses a live window while allowing different hosts to run in parallel. The process registry preserves the live owner across handoff exits.
  • Disconnect, Stop Server, and application shutdown close the relevant child windows. Transient reconnects preserve and repoint the live window.
  • Serve/forward setup is failure-atomic: a failed switch restores the previous ready Serve view and token. A window-open failure after Serve commit is surfaced and remains retryable.
  • Provider setup is enabled only for loopback listeners, inherits Serve token/password authentication, requires JSON POSTs, bounds request size, writes through the existing locked 0600 credential store, and never returns the submitted secret.
  • Credential persistence and Controller rebuild are serialized with model/session rebinds. A successful rebuild swaps the Controller once; a failed rebuild keeps the saved credential and exposes only a sanitized retry state.
  • Legacy cleanup accepts only allowlisted targets and rejects symlink or containment escapes.

Issues

  • Supersedes the Remote Workbench reconnect direction in #7368; this PR removes that architecture instead of extending it.

Compatibility

  • No persisted data format changes. desktop-remote.json and historical source=remote usage statistics are retained.
  • Removed Wails Workbench bindings are intentionally deleted together with all frontend callers.
  • Hidden legacy Workbench CLI commands remain as one-release error stubs that direct users to reasonix remote connect <host> --open.
  • reasonix serve no longer aborts solely because a resolvable selected Provider is missing its API key. Unknown model/provider references still fail at startup, and non-loopback listeners never expose the credential-writing setup endpoint.

Verification

  • go test -p 1 ./... -count=1
  • go test ./internal/serve ./internal/cli -count=1
  • go test -race ./internal/serve -run 'TestProviderSetup|TestSwitchModel|TestServeSwitch|TestResume' -count=1
  • Real CLI subprocess: a keyless reasonix serve --addr 127.0.0.1:0 --port-file ... --auth token published its port and served the authenticated setup page.
  • ./scripts/cache-guard.sh
  • git diff --check
  • cd desktop && go test -count=1 -timeout 300s ./...
  • cd desktop && go test -count=1 -race -run 'TestEnsureServer(FailureKeepsOwnershipOnPreviousReadyServe|ReplaceFailureKeepsOwnershipOnPreviousReadyServe|FirstStartFailurePublishesError|ResultCannotMutateReplacement)|TestRemoteWindow(RegistryHandoffExitKeepsLiveWindow|DisconnectClosesLiveWindowAfterHandoff|ReconnectRepointsWindow)|TestConsumeRemoteWindowTicketRejectsExpiredTicket' .
  • cd desktop/frontend && pnpm test:typecheck
  • cd desktop/frontend && pnpm test:remote (101 assertions)
  • cd desktop/frontend && pnpm test (4021 assertions)
  • cd desktop/frontend && pnpm build
  • Windows amd64 cross-build passed.

Manual validation still required

  • UNVERIFIED: native child-window behavior on Windows, macOS, and Linux.
  • UNVERIFIED: real Windows Desktop to Linux Host and macOS Desktop to Linux Host SSH paths.

This PR remains a draft until the native/real-SSH matrix is exercised.

Documentation impact

Documentation-impact: updated - rewrote the CLI and user guides around Open Remote Web, removed the Remote Workbench guide, documented remote Provider credential ownership, and documented the loopback-only remote Provider setup flow.

Cache impact

Cache-impact: none - Serve now allows the already-supported keyless Controller bootstrap so its setup UI remains reachable, but model request serialization, provider wire shapes, prompt content, tool ordering, and persisted transcripts are unchanged. Cache-guard: ./scripts/cache-guard.sh passed on the published HEAD. System-prompt-review: reviewed in this PR - the keyless Serve setup path does not alter generated prompt content or ordering.

SivanCola avatar Aug 05 '26 00:08 SivanCola