Skip to content

Connect to another computer just works: starts Solenta there, signs in, shows connection status (#1660) - #1674

Merged
currentbits merged 2 commits into
coder/onboarding-agent-readiness-1659from
coder/make-running-solenta-on-another-machine--014215
Oct 18, 2026
Merged

currentbits merged 2 commits into
coder/onboarding-agent-readiness-1659from
coder/make-running-solenta-on-another-machine--014215

Conversation

@currentbits

@currentbits currentbits commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Closes #1660. Stacked on #1673. Merge that first, then retarget this PR to main before deleting its branch.

Running Solenta on a second machine used to need a prior --serve-web launch, a copied token, and guesswork when it failed. Now you enter an SSH host and press Connect.

A. SSH hosts just work

  • Every web start writes the ssh-readable web-token, including the Settings switch. Its device row is renamed "SSH and command line".
  • Connect runs one SSH prepare step. If nothing answers, it starts Solenta on the host (headless), then reads the token.
  • If Solenta is already open there, --serve-web hands off through the single-instance lock and turns web access on.
  • Plain-language errors: host key, password-only login, unknown host, Remote Login off, timeouts, not installed, too old.
  • Linux hosts without Solenta get an Install Solenta on button. It installs this build's own release tarball, checksum-pinned, into ~/solenta, and reports any missing libraries as an apt install line. Older hosts get Update. After connecting, the host's version and agent sign-ins are listed.

B. Sign-in and connection status

  • The styled token gate replaces the bare boot form.
  • A wrong or revoked token closes with 4401: the client stops retrying and the gate comes back with the reason.
  • A reconnecting banner appears after 1.5 s and says when a message is waiting to send. This is in the web UI and in remote windows.

C. Connections pane and guide

  • The pane is split into "Let other devices in" and "Connect to another computer", with steps and a pointer to SSH remote projects.
  • New docs sections in site/docs.html and the README. Fixed the bare solenta --serve-web example (no such command on macOS) and the stale --host comment.

E. Headless

  • --headless implies --serve-web and opens no window.
  • It prints the address, token, link and a terminal QR. The docs include a systemd user unit.

Safety fix found in review. The prepare step open -ned Solenta whenever nothing answered. If the running copy was older than the macOS single-instance lock, or updated on disk but not restarted, it never took the hand-off. The new process then booted as a second writer on the shared store; this Mac's own Nightly was in that state. Now:

  • A running copy only gets --handoff-only if its bundle knows the flag. Otherwise Connect asks you to turn on Serve Solenta Web there.
  • --handoff-only exits instead of booting when it gets the lock.
  • macOS takes the lock, but only --serve-web launches exit on it, so prod and nightly still run side by side as before.

Tests: typecheck and vite build pass. Full suites in a CI-like env: renderer 3140 pass / 0 fail, electron 4899 pass / 0 fail. The prepare script ran in an arm64 Linux container against an ELF stub for four cases: cold start, running but too old (exit 5, nothing launched), running and able to take the hand-off, and not installed.

Not tested end to end: a real Solenta Linux build running headless, and a real Mac host over SSH. The macOS detection lines were only dry-run read-only on this Mac.

🤖 Generated with Claude Code

Willem and others added 2 commits October 18, 2026 22:52
Connect's host prepare step `open -n`ed Solenta whenever nothing answered
on the web port. A running copy older than the macOS single-instance lock
(or updated on disk but not restarted) never took the hand-off, so the new
process booted as a second writer on the shared userData.

- Already running: launch the same build with --handoff-only, and only if
  its main.js knows that flag; otherwise exit 5 with "turn on Serve Solenta
  Web there". --handoff-only exits instead of booting when it gets the lock.
- macOS takes the lock but only --serve-web launches exit on it, so a
  prod and a nightly can still run side by side as before.
- A --serve-web hand-off during boot is applied once webAccess exists.
- Plain-language SSH errors for unknown host, Remote Login off, timeouts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T20:59:51.817333Z 19f34ff PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 19f34ffa02

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread electron/main.js
// ponytail: turns the saved switch on (saved LAN choice, default port);
// the other launch's --serve-web=PORT / --serve-host are not applied.
if (webAccess) {
void webAccess.setEnabled({ enabled: true }).catch((err) =>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor the requested port during single-instance handoff

When Connect targets a non-default port and Solenta is already running with web access disabled, the SSH preparation launches --serve-web=<port> --handoff-only, but this handler discards the parsed port and calls setEnabled with only enabled: true. The running app therefore listens on the default port 4620 while the preparation script waits on the requested port (for example 4700) and eventually reports that Solenta failed to start. Pass the parsed port through the handoff/start path.

Useful? React with 👍 / 👎.

const p = Number(port);
return `sh -c '
tok() { cat "$HOME/Library/Application Support/Solenta/web-token" 2>/dev/null || cat "\${XDG_CONFIG_HOME:-$HOME/.config}/Solenta/web-token" 2>/dev/null; }
up() { command -v curl >/dev/null 2>&1 || return 0; curl -s -o /dev/null -m 2 "http://127.0.0.1:${p}/"; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Probe the remote port when curl is unavailable

On a minimal Linux host without curl, up() returns success without checking the port, so the surrounding if ! up skips all cold-start logic. A host with Solenta installed but not running then either returns no token or later fails because nothing is listening, defeating the new automatic startup path; this also affects wget-only hosts that the installer explicitly supports. Use an available probe such as wget, or treat a missing probe tool as not up.

Useful? React with 👍 / 👎.

@currentbits
currentbits merged commit 5ceac7b into coder/onboarding-agent-readiness-1659 Oct 18, 2026
6 checks passed
currentbits added a commit that referenced this pull request Oct 19, 2026
…n, shows connection status (#1660) (#1674)

* Remote access setup from ce03de (#1660)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Never boot a second store writer when Connect hands off to a running app

Connect's host prepare step `open -n`ed Solenta whenever nothing answered
on the web port. A running copy older than the macOS single-instance lock
(or updated on disk but not restarted) never took the hand-off, so the new
process booted as a second writer on the shared userData.

- Already running: launch the same build with --handoff-only, and only if
  its main.js knows that flag; otherwise exit 5 with "turn on Serve Solenta
  Web there". --handoff-only exits instead of booting when it gets the lock.
- macOS takes the lock but only --serve-web launches exit on it, so a
  prod and a nightly can still run side by side as before.
- A --serve-web hand-off during boot is applied once webAccess exists.
- Plain-language SSH errors for unknown host, Remote Login off, timeouts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Willem <[email protected]>
Co-authored-by: Claude Opus 5.5 <[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