Skip to content

feat(auth): add headless Codex device authorization - #206

Merged
lg2m merged 3 commits into
mainfrom
feat/eng-809-codex-device-auth
Sep 26, 2026
Merged

lg2m merged 3 commits into
mainfrom
feat/eng-809-codex-device-auth

Conversation

@integrate-your-mind

Copy link
Copy Markdown
Collaborator

ENG-809.AUTH: headless Codex enrollment for QQ

Spec: docs/plans/progress/codex-device-auth.md

Linear: ENG-809 · ENG-791

What changed

  • Add opt-in qq auth login openai-codex --device-auth: display a verification URL and user code on a headless host, then poll for authorization.
  • Reuse QQ's existing identity validation, protected credential store, durable refresh state and refresh locking. Browser/loopback login remains the default.
  • Bound protocol input, polling, cancellation and the authorization deadline. Reject malformed responses, unsafe prompt characters and invalid PKCE data before storage.
  • Reuse the accepted loopback callback repair and correct one existing macOS test fixture's temporary-path canonicalization without changing production SQLite policy.

How verified

Candidate: 9897c6aebaec869195a84aaa17a02b34254c92d4, tree 2ceee4a3ad987ab62b930c5c57b337f1cfe1781f, based on bd8c580b38eab0ec71c047150223989512dadd44.

The exact-head workspace log has 29 complete result blocks: 1,925 passed, zero failed, five ignored. The ignored cases are existing benchmark/measurement/manual-reconstruction/AWS-timing/TUI-gallery tasks, not authentication tests. A receipt wrapper failed after Cargo completed because it assigned zsh's read-only status variable; Cargo's exit was not separately captured. This is disclosed rather than relabeled as a successful wrapper invocation.

Formatting, strict workspace Clippy, workspace build and diff check each have an independently recorded exit 0. The auth crate has 64 passing tests, including the repaired deadline and independent-store cases.

Required commands use the repository's pinned Rust 1.97.1, an isolated canonical temporary root and no inherited provider credentials:

cargo test --workspace
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo build --workspace

The focused regression set covers late poll/exchange responses, cancellation, independent credential-store refresh ownership, protocol failures, storage failures and browser-login compatibility. No exchange occurs after a late poll, and no credential is stored after a late poll or exchange. Independent review of the initial candidate found both the deadline defect and the missing independent-store coverage; they were repaired in the second commit.

The non-author reviewer accepted this exact repaired head for the bounded offline slice after reading the full initial diff and repair delta and independently rerunning seven device/deadline cases plus the separate-store refresh case, each command exiting 0. The refresh test requires one refresh owner and the same newest credential and epoch after reopening storage. The real persistent-runner test remains a separate, uncompleted acceptance row.

The guide build passed on Node 24.13.0 with 14 pages and all 477 internal links resolving. Nub/Nix were unavailable locally, so the frozen pnpm lockfile was used via pnpm --ignore-workspace install --frozen-lockfile and pnpm --ignore-workspace run build; this fallback avoids interpreting nub's workspace configuration as a pnpm workspace. No lockfile or source configuration was changed. The hosted workflow's nub path is a separate check, not established by the fallback result.

Docs and compatibility

Provider design, CLI reference, provider guide, quickstart and the slice ledger are updated. No schema, wire protocol or default login-mode change; no new inference loop or credential daemon.

Rollout and remaining qualification

This is an offline-qualified enrollment implementation, not proof of live OpenAI acceptance or unattended operation on an ephemeral Cloud filesystem. Initial authorization still requires the account owner's consent and applicable account support. Avoiding repeated login across jobs additionally requires a protected persistent store with refresh writeback. The real runner's enrollment, second job, restart and refresh tests remain tracked under ENG-809.

No credentials, raw provider output or generated build artifacts are included. No live login, model request, deployment, tag or release is performed by this PR. Merge/release remains under the existing founder review boundary.

Add an opt-in offline device flow for OpenAI Codex while preserving the browser default and existing protected credential storage and refresh behavior. Include bounded protocol fixtures, failure-path coverage, provider documentation, and the accepted macOS temp-root test repair.\n\nSlice: ENG-809.AUTH
Bound device polling and token exchange by the remaining authorization time, reject late results before storage, and add independent-store refresh ownership coverage.\n\nReview repair for ENG-809.AUTH.
@lg2m
lg2m marked this pull request as ready for review September 26, 2026 19:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-26T19:04:58.102196Z 25df5e1 Draft marked ready
ℹ️ 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.

@lg2m
lg2m merged commit 10c2bc0 into main Sep 26, 2026
6 checks passed
@lg2m
lg2m deleted the feat/eng-809-codex-device-auth branch September 26, 2026 19:00
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.

3 participants