Skip to content

A channel can run its agents on one named computer - #1306

Merged
Varuas37 merged 6 commits into
mainfrom
claude/project-thread-xquerh
Nov 11, 2026
Merged

Varuas37 merged 6 commits into
mainfrom
claude/project-thread-xquerh

Conversation

@Varuas37

Copy link
Copy Markdown
Contributor

Before: A channel's main agent and its threads could run only on This Mac, Boat, or (threads only) Any computer.

After: Either can also run on one named computer: an SSH host the gateway serves or a paired computer. Channel settings and the new-channel flow list those computers, and a computer the gateway does not serve is refused with channel_place_unavailable.

Closes #1305

Background

Slice P5 of the plan "Simplify where agents run". P1 (#1293) made one Place type, P2 (#1301) one rule that decides a new conversation's place, and P3 (#1303) trimmed Environments to places only. A channel keeps two places: one for its main agent (coordinator) and one for the threads it starts.

The problem

  • The channel store only accepted the words local, boat and pool (SQL CHECKs), and the domain refused pool for the main agent.
  • So a person who had a devbox over SSH, or a paired Mac, could pick it for one chat but never make it a channel's home.
  • The client also rejected pool coming back for a main agent, and the phone's contract does not even list pool for threads.
sequenceDiagram
    participant P as Person
    participant D as Desktop
    participant G as Gateway
    P->>D: open channel settings
    D-->>P: This Mac / Boat / Any computer only
    Note over P,D: devbox and paired Macs never offered
Loading

The solution

sequenceDiagram
    participant P as Person
    participant D as Desktop
    participant G as Gateway
    participant W as Worker "devbox"
    D->>G: devices.list
    G-->>D: online workers + SSH hosts
    P->>D: Computer ▸ devbox (threads)
    D->>G: channel.setPlacement(threads = "devbox")
    G->>G: is devbox served? (under the channel lock)
    alt served
        G-->>D: ok, saved in channels.sqlite3 v6
        P->>D: new chat in the channel
        G->>W: run it on devbox
    else not served
        G-->>D: channel_place_unavailable
    end
Loading
  • Domain (6ec9311): ChannelExecution holds any Place. The words local, boat, pool keep their meaning; any other word must name an SSH host or peer:<key>. The internal names here, peer:any and boat:thread are refused. The main agent may now use the pool.
  • Store (6ec9311): channels.sqlite3 goes to v6. channels-any-place.sql rebuilds the three tables whose placement columns had CHECKs and keeps every row.
  • Service (6ec9311, 2a1b166): create and setPlacement check a named computer against the places the gateway serves, under the channel's lock and only when it changes, so a channel already on a computer that is offline still loads and can move.
  • Wire (6ec9311): placement fields are 1-253 byte strings; new error code channel_place_unavailable. Generated Rust and TypeScript regenerated.
  • Desktop (6ec9311, 2a1b166): channel settings gain a Computer segment with a menu of online workers and SSH hosts (hosts named like a kind are left out). The new-channel flow offers the same; a refusal sends the person back to the placement step. Headings use channelPlaceWords (Local / Boat / Any computer / host name).
  • Stress step place (6ec9311, 8e6a5b1, 189569f): pairs a worker, picks it for a channel's threads from the settings dialog, starts a chat in the channel and checks its lease is on that worker; also checks an unknown peer is refused.

How we checked it

  • Stress: place alone, 20/20 held on latest main. The full gate runs in CI.
  • Library tests: channel and place tests (268) pass, including a v1-v5 → v6 upgrade test that keeps rows and then stores devbox, and a service test where a channel names a served host and its new chats run there. The full nessa-server lib suite passed before the rebase; the 6 tests that need a non-root user fail on main too.
  • Desktop: typecheck and the workspace/client vitest suites pass (2,253 tests), with a settings test for a channel on devbox.
  • Clippy: -D warnings on Linux, and on Windows through the mingw cross-check.
  • Review: one independent review round; its findings (stress destructuring, SSH hosts named like a kind, a check-then-save race, wording) are fixed in 2a1b166. A second round found nothing actionable.

Tradeoffs and follow-ups

  • Moving the main agent still starts a new main conversation. The plan wants it kept; that needs P4's changeable placement record, so it waits on P4.
  • A typo becomes an SSH host name. Place::named reads any plain word as a host, so "devbx" is refused as channel_place_unavailable, not as an unknown word.
  • The phone must be re-vendored to decode the new values (its contract lacks pool for threads already). That follows in nessa-ios once this merges.

Rollout

The channel store upgrades itself from v5 to v6 on first open, in one transaction. Rolling back means restoring a v5 channels.sqlite3 from backup, since older builds refuse a newer schema.


Generated by Claude Code

Channels hold any Place: local, boat, pool, or one computer by its place
name (channels.sqlite3 v6 drops the word CHECKs). A computer the gateway
does not serve now is refused channel_place_unavailable. The main agent
may use the pool. Desktop channel settings and the new-channel flow list
the connected computers; stress step `place` runs a channel's thread on
a paired worker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JcBpmUavSQzUs5aJwmDfpv
The stress step reads the channel create answers; the place check runs
under the creation lock against what the channel holds now; SSH hosts
named like a kind word are not offered as computers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JcBpmUavSQzUs5aJwmDfpv
@Varuas37
Varuas37 marked this pull request as ready for review November 10, 2026 22:25
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3a1c77fc-e1a1-4a27-9fae-3325cc43d915
  • 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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T22:27:56.063465Z 189569f Draft marked ready
ℹ️ 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: 189569ff1f

ℹ️ 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".

The architecture check keeps the desktop workspace model from importing
the client SDK. channelPlaceWords names a computer the way the client
names a place, so it moves to ui/channel-place-words.ts; the model keeps
only the ChannelPlace type and channelPlaceKind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JcBpmUavSQzUs5aJwmDfpv
The step under test now goes through the surface a person uses, as the
stress rules ask: the channel is chosen in the sidebar, ⌘N opens its
home, and the message is typed and sent. The step checks the chat is
listed in the channel, its lease is on the worker, and the window says
where it runs. It goes back to the default channel before reopening the
main conversation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JcBpmUavSQzUs5aJwmDfpv

Copy link
Copy Markdown
Contributor Author

The conversation stress job failed in one place: the WebKit-only devices run. Its two checks were "Pair a device was not offered again after cancelling" and "Add a computer shows []", both on the Devices page.

This PR doesn't change the Devices page or its pairing flow. The only Devices code it touches is a read of devices.list from the channel settings dialog, which that run never opens. On this same head, every Chromium step passed, including place, channels and devices. The job also passed on main at 82b2705.

I've re-run the failed job once. If it fails again, I'll treat it as this PR's and dig in.


Generated by Claude Code

@Varuas37
Varuas37 merged commit 14982a9 into main Nov 11, 2026
25 of 27 checks passed
@Varuas37
Varuas37 deleted the claude/project-thread-xquerh branch November 11, 2026 00:07
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.

A channel can run its agents on one named computer (Place P5)

2 participants