Repository navigation
feat(auth): add headless Codex device authorization - #206
Merged
Merged
Conversation
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
marked this pull request as ready for review
September 26, 2026 19:00
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ENG-809.AUTH: headless Codex enrollment for QQ
Spec:
docs/plans/progress/codex-device-auth.mdLinear: ENG-809 · ENG-791
What changed
qq auth login openai-codex --device-auth: display a verification URL and user code on a headless host, then poll for authorization.How verified
Candidate:
9897c6aebaec869195a84aaa17a02b34254c92d4, tree2ceee4a3ad987ab62b930c5c57b337f1cfe1781f, based onbd8c580b38eab0ec71c047150223989512dadd44.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
statusvariable; 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 --workspaceThe 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-lockfileandpnpm --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.