Repository navigation
feat(onboarding): add explicit resumable connection setup - #289
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: daaa096731
ℹ️ 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".
| intent = {'invitationDigest': digest(path), 'device': invitation['device'], 'route': args.route} | ||
| if saved and saved != intent: | ||
| raise Rejected('setup_pairing_intent_changed') | ||
| work.saved['pairing'] = intent | ||
| work.phase('pair', 'pending') |
There was a problem hiding this comment.
Validate invitations before pinning the pairing intent
When the first pairing attempt uses an expired/malformed invitation or selects a route absent from the invitation, this code persists that digest and route before pair() performs its local validation. The attempt then fails without any network mutation, but a replacement invitation or corrected --route is rejected as setup_pairing_intent_changed, while cancel does not clear the intent, permanently blocking normal setup for this initialized state. Validate the invitation and requested route before saving the pairing intent, reserving the immutable pending state for attempts that can actually begin pairing.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in the new commit: validate invitation shape, expiry, certificate/key fields and advertised route before saving any pairing intent. Resolve auto to the actual supported direct/relay route before effect; invalid local inputs leave no retained pairing intent, while possibly attempted valid intents remain fenced. The file is read once so validation and retained digest describe the same input. Added malformed/expired/unavailable-route → corrected valid invitation regression; focused setup/core/Control tests 40 PASS. No uncertain operation is reset or automatically retried.
Summary
Refs #211. Add an explicit, resumable
session-peer setupflow while retaining the existing manual commands and lightweight local/SSH CLI.--apply; setup never sends a test message.listas the default, an explicit optionalsendpermission, exact target/home/executable selection and pre-apply revalidation. Create private files exclusively or reuse an identical policy; never broaden or overwrite a different policy.Type
Checklist
Verified against
macOS arm64 / Python 3.13.7, isolated optional Relay/MCP test environment. No actual Claude/Codex/Antigravity message, public Control request, browser login, installation rollout or live service change was performed.
tools/generate_session_peer.py --checkandgit diff --check: PASS.306bc37855f29e17e7d130ce2d49cb6a88e41b6c: 823 tests PASS / 12 skips using-X dev -W error::ResourceWarning. The suite emitted the previously observed asyncio incoming-connection/teardown assertion diagnostic during existing Relay tests while unittest still finished with zero failures. It is disclosed rather than treated as a clean zero-diagnostic execution; prior exact-head suites at daaa096 and 6899b0b passed without that diagnostic.306bc37855f29e17e7d130ce2d49cb6a88e41b6cwas independently accepted after a bounded read-only delta review and 41 focused tests PASS; no additional confirmed scoped blocker was found.Notes
Automatic review finding about prematurely retaining invalid pairing input is addressed: validate shape/expiry/certificate/route plus local recovery/key refusals before persisting intent; resolve
autoto the advertised route. Only a potentially attempted valid pairing intent is immutable. Added malformed/expired/unavailable-route → corrected input and locally revoked-key regression tests. The invitation is read once for validation and its retained digest.Private
setup.jsonis protected 0600 recovery material; it retains certificate and operation data, but never login tokens or invitation secrets. Do not publish it. Native exactly-once delivery and the frozen handoff contract are unchanged.The existing authenticated enrollment API must already support operation UUID receipt reconciliation. This PR does not change Control protocol or deploy a hosted service.
Inventory's immutable SQLite view is diagnostic and checkpointed, not current authorization. Live pre-mutation state validation reads existing metadata without initialization. Known service files and receiver locks are reported; arbitrary service discovery is explicitly incomplete. No service installation/autostart is offered. Existing systemd/launchd management remains separate.
Client readiness is authenticated metadata/probe evidence, not a message ACK, model consumption, native agent approval or availability guarantee. Interrupted invitation creation requires manual reconciliation; expired login requires explicit re-login while retaining the original enrollment intent. Cancellation does not roll back a committed operation or cancel an original message.
Relay setup remains Unix/Python 3.11+ with optional extras. Windows native Relay setup, real headless/browser Control approval, actual agent delivery, real-host SSH and production service acceptance were not validated here.
This isolated branch starts from
10a9cef; sibling v1.1.0 PRs are separate. Shared parser/generated and paired-device documentation changes require integration verification before any merge. No merge, release, deployment or live experiment is part of this PR.