Skip to content

fix: VPN launch refusals scoped to the right account; Mythos/Daybreak refuse without a marked account, opt-in reserve - #2355

Merged
Th0rgal merged 2 commits into
masterfrom
claude/fix-vpn-launch-mythos-58241b
Nov 30, 2026
Merged

Th0rgal merged 2 commits into
masterfrom
claude/fix-vpn-launch-mythos-58241b

Conversation

@Th0rgal

@Th0rgal Th0rgal commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Fixes the VPN reasons missions were refused, and closes the Mythos/Daybreak account gaps. Follows #2333, #2343, #2349, #2352.

VPN launch refusals

  1. Local harness without the router (local_harness_vpn_requires_router). It used to refuse every local Claude Code/Codex/Grok/OpenCode mission once any account had a VPN route. It is now scoped to the provider whose login the harness would use without the router: Claude Code → Claude accounts, Codex → ChatGPT accounts, Grok → xAI accounts. OpenCode and Pi can reach any provider, so they keep the old rule. A single helper, RemoteDispatch.anyVpnConfiguredFor? with harnessVpnCategory?, replaces the xAI-only anyXaiVpnConfigured?, so remote Grok and local turns follow one rule.
  2. Core-host Antigravity (antigravity_vpn_requires_account_binding). This path used to accept exactly one enabled VPN account and fail otherwise. Account selection now lives in one function, RemoteDispatch.chooseAntigravityAccount?, taken out of adminDirectAntigravityStaticTarget? with unchanged behaviour. The local path uses it too. It goes through accounts in priority order and passes over any account whose route can't be had right now. The turn then runs as the chosen account: its login is written to a private home for the mission (<root>/core-turns/agy-home/<mission>, set as HOME), and a VPN-routed account goes only through its relay. While no Antigravity account is VPN-routed, the host's own login is used as before.
  3. Same-provider accounts on one exit stay refused (vpn_exit_in_use), as decided. Allocation already tries every running and configured profile in the country before refusing. What was wrong: when a profile existed but another account of the same category held its exit, the answer was vpn_no_compatible_profile ("import a profile"). That reason isn't transient, so account selection didn't pass over the account. It now answers vpn_exit_in_use. When the accounts routed to a country outnumber its distinct configured servers, the refusal now says so in numbers, both in the account row and in a refused launch (AccountVpnPool.exitDemand / exitShortageNote). Example: "2 accounts of this provider use NL, and each needs its own exit, but only 1 server is configured for NL…"
  4. Branch triage. All 19 unique commits on codex/airvpn-observed-country, and the 12 on codex/antigravity-account-vpn-integration (which are a subset of those), are already on master, squashed in under other SHAs. That includes 3e461a2: master lets a member configure the VPN route of any account listed for them, which is broader than the branch's "accounts they added" (Control.lean, providerListedFor; test in ProviderContractTests). It also includes de38356, the lowercase country codes (AirVpnObservation.lean:40). Nothing is ported, and both branches can be deleted.

Mythos / Daybreak

  1. A request that needs CVP or Daybreak, when no account is marked with it, used to go to whichever subscription the pool picked. Subscription targets are now dropped, and the proxy answers 403 no_cyber_access_account with a message asking the operator to mark the account. API-key targets are still outside the rule.
  2. Opt-in "Keep for Daybreak/CVP missions" per marked account. Ordinary requests never use a kept account, not even as a last resort. A pool that includes a kept login and can't be split login by login is dropped. If only kept accounts serve the model, the proxy answers 403 only_reserved_accounts. Storage: a reserved column on account_cyber_access, added by an additive migration. API: reserved on the cyber_access object, and an optional reserved in the PUT. Leaving it out keeps the saved choice, and clearing the mark clears it. Desktop: a second switch in the expanded account, with the same optimistic update, rollback and Retry as the mark switch. The shared fixture gains reserved, reserveTitle and reserved_rule.
  3. HTTP contract test for /api/ai/providers/:id/cyber-access. It covers member read, admin-only write, wrong provider family, API-key account, unknown account, malformed body, reserving an unmarked account, the reserve round trip, clearing, and cyber_access on the list.
  4. iOS/Android parity: not in this PR. Mobile doesn't show the Daybreak/CVP badge yet; that gap already existed on master since feat: per-account Daybreak / CVP mark for subscriptions, shown in Inference and used when choosing an account #2349. A follow-up PR is proposed, built on the fixture in this branch.

Tests (replay each refusal order)

  • ProviderContractTests v1:
    • an xAI route no longer refuses local Claude Code or Codex, but still refuses Grok, OpenCode and Pi; a ChatGPT route then refuses Codex but not Claude Code.
    • Core-host Antigravity with a busy first VPN account runs as the second (Direct) account with its own login and no proxy.
    • both busy: refused with antigravity_vpn_unavailable:vpn_exit_in_use.
    • second account VPN-routed and free: runs through its own relay URL.
  • ProviderContractTests 8b: nothing marked plus a need gives no subscription target; reserve cases (ordinary request never reaches the kept account, a need still does, a reserve on an unmarked account has no effect, all kept leaves an empty chain, an unsplittable pool is dropped).
  • HarnessProxyTests: category scoping of anyVpnConfiguredFor?.
  • orb/tests/account-cyber-access.test.tsx: fixture parity, reserve switch, rollback, member view.

Trade-offs

  • A Core-host Antigravity turn sets HOME to a private mission directory once any Antigravity account is VPN-routed, like nodes already do. Tools in that turn don't see root's ~/.gitconfig and similar files.
  • Reserving or marking makes Core address logins one by one instead of letting the sidecar spread load across the pool (already the case once a mark exists, per the spec).

Checks

  • scripts/build_orb_bins.sh --only orb-core --only orb-core-test, built cold on uruk (x86_64): build OK. orb-core-test: EXIT=0.
  • orb/: tsc --noEmit clean; vitest run: 271 files, 2522 tests passed (3 skipped).
  • Not run: turbo-lean audit-spec, since Orb/Spec.lean is unchanged; pnpm test:browser; iOS and Android, since nothing mobile changed.

- Local Claude Code/Codex/Grok without the router are refused only by a VPN
  route on an account of their own provider (one helper, anyVpnConfiguredFor?).
- Core-host Antigravity turns choose the account like node dispatch
  (chooseAntigravityAccount?), pass over a busy route, and run as the chosen
  account with its own login.
- An occupied exit answers vpn_exit_in_use; refusals say exits needed vs
  configured.
- A request needing Daybreak/CVP with no marked account gets 403
  no_cyber_access_account; opt-in per-account reserve for marked requests.
- HTTP contract test for /api/ai/providers/:id/cyber-access.
@Th0rgal

Th0rgal commented Nov 30, 2026

Copy link
Copy Markdown
Owner Author

Mobile parity follow-up (item 8): #2356 shows the Daybreak/CVP mark and the kept state on accounts in the iOS and Android Inference screens. It is stacked on this branch.

@Th0rgal
Th0rgal merged commit b12e98a into master Nov 30, 2026
32 checks passed
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