Skip to content

Sign in to Codex on a headless OX host from mobile - #110

Merged
n0rpan merged 47 commits into
mainfrom
mobile/codex-sign-in
Nov 29, 2026
Merged

n0rpan merged 47 commits into
mainfrom
mobile/codex-sign-in

Conversation

@n0rpan

@n0rpan n0rpan commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

Track phone-only setup in #95. The phone shows the host’s reviewed Codex device sign-in command, asks the user to run it, and presents the one-time code with a Copy code button. The browser link opens the stock ChatGPT device page after a tap. Account status refreshes when the host command exits. The host’s existing terminal grant still controls access.

Stacked on #105 and #97. Checked against main at b61f132. Built and linked the unsigned arm64 iPhone app on Linux with xtool’s Darwin linker. Six terminal protocol tests passed, including the stock URL and device-code filters. Live sign-in and returning from the browser still need device verification.

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 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-29T06:31:59.766490Z 2317c64 Manual request
🔒 Security Review ✅ Completed 2026-11-28T20:39:40.282089Z 654f5bc 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.

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.
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.

(cherry picked from commit 1e52e2c)
Base automatically changed from mobile/operator-client to main November 29, 2026 03:19
n0rpan and others added 10 commits November 29, 2026 04:21
Transplant the three QR commits (3172630, 45d5c95, 9bbeb1d) onto
1711f60's native iPhone composer. The shared invitation parser, the
manual pairing fallback, the camera usage description and the camera
permission handling are kept. The incidental mobile-beta changes that
were on the previous PR head are left out.

Co-Authored-By: Claude Code <[email protected]>
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]>
@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 2317c64 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 2317c64.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 2317c6417f

ℹ️ 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 06:32
@n0rpan
n0rpan added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit d608902 Nov 29, 2026
41 of 58 checks passed
@n0rpan
n0rpan deleted the mobile/codex-sign-in branch November 29, 2026 07:08
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