Repository navigation
feat(mobile): let paired phones use chats on WSL hosts - #28972
brennanb2025 wants to merge 9 commits into
Conversation
|
Paired phones could not open chats on a stopped WSL host because the desktop did not relay phone work into the host’s reconnect policy. After a desktop restart, the phone could also lack a saved project row to tap, and a phone action joining a connection already opening could lose its request during a bridge refresh. At Round 2 is complete: correctness, lifecycle and readiness source reviews agree with the fixes. Their single catalog regression was corrected and checked against the rule that an unreachable host must not erase saved phone rows. Controlled source probes covered sixteen relay schedules and five catalog scenarios; these are not the test suite or real UI proof. The existing startup recordings now match the sleeping-agent guidance, and the link data class/types moved unchanged into a focused module for the file-length check. Mobile CI passed 10,239 tests (6 skipped), including all recording/replay assertions, plus typechecks. Its lint job is blocked by an unrelated chat-view test file on main exceeding its line limit. The full PR workflow’s typecheck and changed-code quality checks passed, but lint also found an unrelated Git test over its line limit; this PR changes neither test file. The browser bundle job hit an HTML-preview navigation timeout in unchanged code, and desktop test shards were skipped after lint failed. Green current-head CI and coordinator-owned Windows/phone QA with screenshots remain required, so this PR is not ready to merge. Intended: the paired desktop must remain reachable, and explicit work demand lasts until the phone relay disconnects. Temporary limitation: a stopped host’s opaque folder workspaces need existing desktop-readable path facts to appear after a cold restart; they become available after reconnect. No new saved inventory or reconnect control was added. For Brennan’s review Before/after screenshots for cold-start Open and sleeping-agent tab wake are still pending coordinator-owned Windows/phone QA. The late-demand timing also needs the deterministic regression checks; a screenshot cannot establish that race.
|
|
Windows QA for head a9790d2 (Windows high spec, real signed-in Claude Code 2.1.302 inside a throwaway WSL2 distro, Codex driving the UI over CDP) Batch 3 (this run):
Earlier batch-2 results on this same head (phase 6). These used a scripted phone client paired over the local network instead of the real phone app, with scripts instead of a driver model:
No screenshots: batch 3 could not run the phone app, and the batch-2 scripted phone has no screen. |
|
Superseded by #33911. |
ELI5
A paired phone cannot use chats on a WSL host because the desktop deliberately excludes those hosts from its relay, and WSL reconnects only for work visible on the desktop. This lets the phone open and send to those chats through its paired Windows desktop, even when that project is offscreen.
What Changed
WSL hosts join the existing configured-server relay behind the existing internal and Experimental gates. Explicit workspace Open, chat create/Send/resume/subscribe, and image-upload requests can acquire host demand; catalog, status, host-wide subscriptions and history reads acquire none. The demand belongs to the phone's relay connection and releases on failure, retirement or disconnect. Desktop-visible work and phone work feed the same WSL reconnect policy.
WSL preparation keeps the configured server registration and signing key fixed while allowing bridge credentials to refresh, then the relay reads the current pairing identity. A removed or replaced server cannot inherit an action already preparing. Established connections keep the existing environment/pairing identity, delegated-phone capability check and retirement fencing; late frames from retired connections are dropped. The phone uses the desktop relay throughout, with no guest endpoint exposed to it and no new wire fields or stream operations.
Neil-owned files extended:
src/main/wsl/wsl-host-service.tsand its existing test; newsrc/main/wsl/wsl-host-work-demand.tsholds connection-scoped demand. No mover changes.Why
The existing relay already owns host routing, delegated phone credentials, uploads and session streams. Extending its connection lifetime and the host's existing demand policy keeps execution on the owning host, with explicit work allowed to wake it. Intended difference: WSL remains reachable through the Windows desktop because that desktop owns its managed transport; desktop-closed connectivity is unavailable. No separate phone-to-guest transport or Windows-owned provider process is added.
Linked Issue
WSL native chat plan, PR 10; extends the phone exclusion introduced by #27933.
Visual Proof
Pending Windows Q7 evidence. No new UI surfaces; existing phone workspace and chat screens use the host relay.
Testing
Contract coverage: passive requests do not acquire wake demand; explicit phone work reconnects an offscreen host; overlapping phone leases release independently; reconnect finishes before pairing resolution without accepting a replacement server; retirement releases demand and discards late frames. Existing relay tests cover delegated-device capability refusal, phone revocation, terminal streams and connection loss; image/approval/attention behavior still needs Q7 proof.
Local
git diff --checkpassed. On commit2ffd244ff4788b22782bf5f611af3fbabb78b71b, PR Checks run 38677462926 passed the full static-analysis/typecheck job, all five unit shards, relay integration, Linux/Windows packaging and thePR checks passedaggregate. No local heavy checks ran under the shared-machine policy. The deprecated remote-typecheck helper exited before running any checks or creating a worktree.Q7 handed to the coordinator for Windows high spec: keep the guest project offscreen; repeated host/status/catalog lists must leave a stopped disposable distro stopped; explicit phone Open/Send starts it; exercise stream, image, approval/question, Stop, history/resume, one completion/attention notification and ACK; desktop loss/re-pair invalidates old streams. Real paired-phone proof is pending; if unavailable, run the relay contract with the repo's mobile emulator path and retain the real-device step as pending.
The separate real-WSL lane failed before tests: the runner already reports WSL 3.0.1, but its install step exits with MSI 1603. This shared runner-setup failure is assigned to the workflow-fix lane; no workflow changes are included here.
AI Disclosure
Review
Self-review includes SSH and folder-workspace routing, unchanged old-peer capability checks, availability gates, pairing rotation and lease cleanup. No new protocol capability is needed because the demand API is desktop-local and optional.
Agent skill upstream boundary
Notes
The desktop must remain reachable. Host status still comes from the existing execution-host authority; contact loss is not process exit.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)