Skip to content

Sign in to Antigravity from OX Mobile - #188

Merged
n0rpan merged 68 commits into
mainfrom
mobile/antigravity-phone-sign-in-pilot
Nov 29, 2026
Merged

n0rpan merged 68 commits into
mainfrom
mobile/antigravity-phone-sign-in-pilot

Conversation

@n0rpan

@n0rpan n0rpan commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

Host settings can start the host’s reviewed Antigravity sign-in. The phone opens the complete Google link captured by the host and accepts the pasted code in a masked field. The signed host grant controls access to the login. The app clears the code when it leaves the sheet or the paired host changes.

This builds on #182. Both Linux mobile builds passed. The 96 mobile tests and 13 terminal-protocol tests use synthetic data. Real Google account sign-in remains to be exercised.

Part of #95 P3.

Add an AVFoundation camera adapter behind a narrow C bridge. The Pair screen requests camera permission, scans an OX invitation, and hands the link to the existing Rust verified pairing flow. Cancel, denied, unavailable and invalid codes keep manual entry available, and the scanner stops after one accepted code so a repeated frame cannot pair twice.

Tracks #95. Based on #97.
The native mobile terminal needs the same signed /api/operator channel the
web phone uses, and the host's review has to come before any process starts.
PairedClient now opens that channel as an Operator that follows the
review/start exchange: run answers the preview once, keys and resize wait
for the host's running frame, and a frame the host would answer by closing
the socket is refused locally.

Event::Screen now carries the login_url the host captures for stock
subscription sign-in. The operator frame bounds live in terminal_protocol so
the host and the client read the same values. The terminal grant, TLS,
cookie, origin and proof are the ones the existing client already uses, and
ox-pty and the host service stay outside the mobile feature.

The native fixture now drives the typed session against a real host after
the raw terminal one.
Settings now offers the host's stock ox login claude beside the ChatGPT
device sign-in. The phone reuses the signed operator session and host review,
opens only the same official Claude origins and /oauth/ path the browser
operator accepts, and never follows a malformed, non-HTTPS, userinfo or
look-alike URL. Claude Code may ask for a pasted code; the app shows a masked
field and clears it on send, back and restart. Terminal output, the sign-in
page and the pasted code stay in memory while the process runs and are
discarded when it ends.

The host captures the complete Claude sign-in line before terminal wrapping,
and the typed client validates it with the same parser. Tests cover the URL
and code parsers, the login preset frame, and the real host review.
The phone now shows and changes the host's update settings through the
existing signed `host_update` settings action, with the host keeping every
update decision.

- Export `host_updates` on iOS and Android and build the settings envelope
  in one place (`host_updates::request`), used by the desktop client and the
  phone, so the command cannot drift between them.
- Add a Host updates screen: installed version, the host's own state
  message, update mode, release channel, scheduled status, schedule/cancel
  and refresh. Unmanaged installations show the status and installation
  guidance without controls.
- Replies are the host's authoritative `Status`; controls are disabled while
  a request is out, a reply is dropped when the paired host or the screen
  changed, and a failed initial load offers a retry.

Tests are wire-only: the command JSON, the settings envelope the server
parses, and the status reply. No test host preferences or downloads run.
n0rpan and others added 16 commits November 29, 2026 05:52
Merge the verified #101 head fca3648 (iPhone QR camera pairing, Live
Sessions catalog, Android API 36 keyboard insets, headless host updates)
into the Codex subscription sign-in branch.

Conflicts were all additive and resolved by keeping both sides:
- mobile.rs: the sign-in screen and state coexist with the QR, keyboard
  inset and host-updates state; navigate() keeps both leave-screen rules;
  settings shows the Host updates and ChatGPT cards.
- remote.rs: the sign-in helpers sit beside the #101 imports and the
  pairing-unreachable guidance.
- README: the sign-in section stays and takes #101's opt-in Live Activity
  heading and text.
The Embedding.h and build-android.sh rerere resolutions were re-checked by
hand against fca3648; this feature does not touch either file.

The resulting tree is fca3648 plus only this branch's Codex sign-in
feature: terminal_protocol device-page and device-code parsing, signin.rs,
the mobile/remote integration and the README section. No build, release or
push settings are added. Checked against origin/main c48a3df: it has no
Codex mobile sign-in, so nothing is duplicated.

Co-Authored-By: Claude Code <[email protected]>
Reconciles the branch with main's new Codex device sign-in from mobile,
approval notification settings, session move progress and Android QR
pairing. The tree is main's, except the eight sign-in files, which carry
exactly this branch's delta from 4a3c1e8..5edc5d9 and nothing else.

Where main and the branch both touched a file:

- mobile.rs: kept main's layout - the notifications module, the sign-in
  fields next to the rest of the struct, the profile-aware qr_scanning -
  and re-applied the sign-in delta on top: SubscriptionLogin in place of
  ChatGptLogin, the Screen::Claude variant, its title, its body and its
  settings card. The Claude card follows the ChatGPT card, ahead of main's
  host-updates, approval-alert and running-process rows.
- README.md and remote.rs: three-way merge of main's new text and fields
  with the sign-in delta; main's Approval alerts section, Live Activity
  paragraph, process listing and push-intent clearing are kept.

terminal_protocol.rs, operator.rs, operator.js, client/fixture.rs and
signin.rs are byte-identical to 5edc5d9, because main's copies of them are
the same blobs as this branch's base commit 4a3c1e8.

Checked: cargo fmt (root and desktop), clippy on ox-host-web and ox-mobile,
ox-host-web lib tests with client+server, ox-mobile lib and
android_qr_decode tests. The mobile UI code in mobile.rs and signin.rs only
compiles for iOS and Android, so it was not compiled here.
`agy acp --login` prints a long Google OAuth URL as one line, and the host
already captured that line whole before the terminal wrapped it. The check
that decides whether the line is the stock Google sign-in page lived in the
operator socket, so a mobile client could only re-implement it.

Move that validation to `terminal_protocol::antigravity_login_url`, next to
the Codex device-page parser the phone already shares. It takes one complete
line: the exact `https://accounts.google.com` origin, the two accepted OAuth
paths and a non-empty query, no credentials and no fragment. It returns the
line's bytes unchanged rather than a re-serialised URL, so whatever opens it
gets exactly what Google printed, and it never searches a screen for a
candidate.

The host Antigravity preset uses the shared parser as its line matcher, and
the browser's own check of the captured line is untouched. The phone does not
consume it yet: this slice is the host prerequisite, with no new PTY,
authorization path or mobile UI.

Tests cover the fixture URL byte for byte, the v2 path, cuts in the scheme,
authority and path, and a screen that contains the URL but is not the one
captured line.

Issue #95 P3.
Settings now offers the host's stock agy acp --login beside the ChatGPT and Claude sign-ins. The phone reuses the signed operator session and host review, opens only the complete Google OAuth line the host captured, and never assembles a link from terminal screen text.

Antigravity can echo a pasted code or redirect URL, so its raw terminal screen is not stored or drawn. The app shows neutral progress and the known fact that Antigravity uses the Google account signed in on the host. The masked code field and all sign-in memory are cleared on exit, cancel, leaving the screen, and switching provider.

Adds provider rules beside the existing sign-in UI, with host tests for the reviewed presets, the captured-only URL rule and the pasted antigravity code. No real OAuth, provider or account is used.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 29, 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-29T10:19:32.617862Z 5f48298 Manual request
🔒 Security Review ✅ Completed 2026-11-29T09:31:29.599661Z 194a472 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.

Base automatically changed from mobile/antigravity-complete-login-link to main November 29, 2026 10:03
@n0rpan n0rpan added the full-ci label Nov 29, 2026
@n0rpan

n0rpan commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator Author

In line to merge. Commit 5f48298 is reviewed with nothing blocking; it enters the merge queue when OX merge check passes.

@n0rpan

n0rpan commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator Author

@codex security review

Asked for by the full-ci label, for commit 5f48298.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 5f48298323

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

@n0rpan
n0rpan enabled auto-merge November 29, 2026 10:19
@n0rpan

n0rpan commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator Author

The Ubuntu package run passed its native suites, then timed out waiting for the desktop probe to switch panes. I requested a rerun of that job.

Job log

@n0rpan
n0rpan added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit 817a906 Nov 29, 2026
72 of 90 checks passed
@n0rpan
n0rpan deleted the mobile/antigravity-phone-sign-in-pilot branch November 29, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant