Skip to content

fix(codex): retry warmup with gpt-5.6-luna on 400 and 404 for ChatGPT Free accounts (#4126) - #4188

Closed
chilung-cgu wants to merge 2 commits into
lidge-jun:devfrom
chilung-cgu:fix/issue-4126-chatgpt-free-warmup-404
Closed

fix(codex): retry warmup with gpt-5.6-luna on 400 and 404 for ChatGPT Free accounts (#4126)#4188
chilung-cgu wants to merge 2 commits into
lidge-jun:devfrom
chilung-cgu:fix/issue-4126-chatgpt-free-warmup-404

Conversation

@chilung-cgu

@chilung-cgu chilung-cgu commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Resolves Newly created ChatGPT Free account fails Codex account warmup with HTTP 404 #4126 where newly created ChatGPT Free accounts failed the account warmup step with HTTP 404 after successful OAuth authentication.
  • Newly created Free accounts may not have gpt-5.4-mini provisioned or available, returning HTTP 404. Furthermore, the previous sole fallback model gpt-5.5 is rejected as unsupported on Free accounts, whereas gpt-5.6-luna is supported and functions correctly in official Codex clients.
  • Expands warmup fallback triggers to handle both HTTP 400 and HTTP 404, and appends gpt-5.6-luna to FALLBACK_MODELS in src/codex/warmup.ts.
  • Updates verifyCodexAccountWarmup in src/codex/auth-api.ts to output an accurate, actionable diagnostic message ("Codex account warmup failed. Verify account model access or provisioning and try again.") on HTTP 400 or HTTP 404 instead of misleadingly claiming that re-authentication is required.
  • Synchronizes documentation across all 8 supported locales in docs-site/.

Closes #4126

Verification

  • Added regression tests in tests/codex-integration/warmup.test.ts:
    • Verified warmup retry cascade on HTTP 404 (gpt-5.4-mini -> 404 -> gpt-5.5 -> 400 -> gpt-5.6-luna -> 200 SSE).
    • Verified non-retryable failures (e.g. HTTP 401) immediately abort without trying fallback models.
  • Ran test suite:
    • /home/ubuntu/.bun/bin/bun test warmup (21 pass, 0 fail, 56 expect calls across 2 test files)
    • /home/ubuntu/.bun/bin/bun run typecheck (strict tsc, 0 errors)
    • /home/ubuntu/.bun/bin/bun run privacy:scan (privacy scan passed)
  • Conducted multi-agent adversarial code review via gemini-3.8-flash-high (reasoning_effort="max") verifying boundary safety, timeout cleanup, token privacy, and error classification.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • All CI tests are green on my local testing.

  • I pushed my PR to the latest dev commit.

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

Summary by CodeRabbit

  • New Features

    • Codex account warm-up now retries after HTTP 400 or 404 responses.
    • Added gpt-5.6-luna as an additional fallback model.
    • Non-retryable errors now stop the fallback process immediately.
  • Bug Fixes

    • Improved handling of authentication and other non-retryable failures.
  • Documentation

    • Updated Codex integration guidance across supported languages to reflect the revised retry behavior.

Copilot AI lite review requested due to automatic review settings September 10, 2026 08:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Deterministic hygiene checks failed.

  • unsponsored_surface — This changes an authentication, workflow, release-automation, or dependency surface. MAINTAINERS.md requires security review for these; ask a maintainer to apply maintainer-sponsored once they have reviewed it. Paths: src/codex/auth-api.ts.

@github-actions github-actions Bot added intake: hygiene-blocked Deterministic PR hygiene checks failed bug Something isn't working labels Sep 10, 2026
@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • review readiness checklist open (0/4 boxes ticked).

What to do

  • Tick all four boxes in the PR description once you're done (currently 0/4).

Review readiness checklist

  • ⬜ All CI tests are green on my local testing.
  • ⬜ I pushed my PR to the latest dev commit.
  • ⬜ I resolved all correct Codex and CodeRabbit findings.
  • ⬜ My PR is ready for review.

0/4 boxes ticked.

This PR stays in draft until every box above is ticked.

Hygiene

Deterministic PR hygiene checks passed.

@github-actions
github-actions Bot marked this pull request as draft September 10, 2026 08:24
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 1287b273-5f9e-4551-901b-6fbdee642d44

📥 Commits

Reviewing files that changed from the base of the PR and between 12c248f and 9a06b6d.

📒 Files selected for processing (10)
  • docs-site/src/content/docs/fr/guides/codex-integration.md
  • docs-site/src/content/docs/guides/codex-integration.md
  • docs-site/src/content/docs/ja/guides/codex-integration.md
  • docs-site/src/content/docs/ko/guides/codex-integration.md
  • docs-site/src/content/docs/ru/guides/codex-integration.md
  • docs-site/src/content/docs/tr/guides/codex-integration.md
  • docs-site/src/content/docs/zh-cn/guides/codex-integration.md
  • docs-site/src/content/docs/zh-tw/guides/codex-integration.md
  • src/codex/warmup.ts
  • tests/codex-integration/warmup.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Codex account warmup now retries HTTP 404 responses and uses gpt-5.6-luna after gpt-5.5. Non-retryable errors stop the retry loop. Tests and localized documentation cover the updated behavior.

Changes

Codex warmup retry handling

Layer / File(s) Summary
Warmup retry logic
src/codex/warmup.ts
Adds gpt-5.6-luna to the fallback list. Treats HTTP 400 and 404 as retryable. Rethrows non-retryable errors immediately.
Retry behavior tests
tests/codex-integration/warmup.test.ts
Covers the 404-to-400 fallback sequence, successful use of gpt-5.6-luna, and immediate failure on HTTP 401.
Localized warmup documentation
docs-site/src/content/docs/*/guides/codex-integration.md
Updates the warmup retry description for HTTP 400 and 404 responses and both fallback models.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 9a06b

Warmup now recovers from documented model-provisioning failures while preserving immediate handling of authentication failures. The supplied regression coverage supports merging with normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (8 skipped: 8 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: warmup retries for ChatGPT Free accounts using gpt-5.6-luna after HTTP 400 and 404 responses.
Linked Issues check ✅ Passed The implementation addresses issue #4126 by treating HTTP 404 as retryable, adding gpt-5.6-luna as a fallback, preserving authentication failures such as HTTP 401 as immediate failures, and adding reg…
Out of Scope Changes check ✅ Passed The code changes, regression tests, and synchronized documentation updates directly support the warmup failure described in issue #4126. No unrelated implementation changes are evident in the provided…
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (8 skipped: 8 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lidge-jun

Copy link
Copy Markdown
Owner

리뷰 · 우선순위 70 / 80

이 PR은 #4126을 직접 고친다. 증상은 ChatGPT Free(특히 당일 생성) 계정에서 OAuth는 성공하는데 Codex 계정 warmup만 HTTP 404로 떨어지고, GUI가 “다시 로그인하라”고 말하는 것이다. 보고자·후속 확인에 따르면 공식 Codex 클라에서는 같은 계정으로 gpt-5.6-luna 턴이 되고, gpt-5.5는 Free에서 “지원되지 않음”이다. 현재 dev HEAD 12c248f52src/codex/warmup.ts는 기본 모델 gpt-5.4-mini, 폴백 목록이 ["gpt-5.5"]뿐이며, warmCodexAccountHTTP 400일 때만 폴백하고 404는 즉시 throw한다. src/codex/auth-api.tsverifyCodexAccountWarmup은 실패 원인을 가리지 않고 401 + “Reauthenticate the account and try again”으로 포장한다. 그래서 모델/프로비저닝 문제를 재인증 문제로 보이게 만든다. 이슈 #4126 리뷰에서 이미 적어 둔 패치 후보(404에도 폴백, Free-safe 모델, 문구 분리)와 이 PR의 방향이 같다.

변경은 세 갈래다. (1) FALLBACK_MODELSgpt-5.6-luna를 추가하고, isRetryableWarmupStatus로 400·404를 재시도한다. (2) 폴백 루프 안에서 재시도 불가 status(예: 401)나 CodexWarmupError가 아닌 오류는 바로 throw하도록 고친다. HEAD의 루프는 폴백 중 401이어도 다음 모델을 더 시도할 수 있었고, 비-CodexWarmupError는 삼키고 lastErr만 남겼다. (3) verifyCodexAccountWarmup이 400/404일 때 “Verify account model access or provisioning…” 문구로 바꾸고, docs-site 8개 로케일 워밍업 문단을 맞춘다. 회귀 테스트는 404→400→luna 성공 체인과 401 즉시 중단을 고정한다. luna 자체는 HEAD의 shadow/catalog/registry에 이미 쓰이는 Codex 헬퍼 모델이라 목록에 넣는 선택이 뜬금없지 않다.

다만 머지 전에 겹치는 축이 있다. 열린 #4144도 src/codex/auth-api.ts·src/codex/warmup.ts를 만지며 warmup 실패를 “재인증”이 아닌 429 레이트리밋 메시지로 나눈다. 둘 다 verifyCodexAccountWarmup 실패 분기와 문구를 고치므로 먼저 들어가는 쪽이 다른 쪽과 충돌한다. 이 PR은 400/404 문구만 바꾸고 JSON 응답의 HTTP status는 여전히 401을 유지한다(HEAD와 동일). 클라이언트가 body 문구가 아니라 status만 보면 여전히 인증 실패로 보일 수 있다. 또한 Free에서 gpt-5.5가 거절된다는 보고가 있는데 폴백 순서는 여전히 gpt-5.5gpt-5.6-luna라서, Free 404 경로마다 알려진 실패 모델을 한 번 더 친다. CI는 hygiene·enforce-target 실패이고 라벨 intake: hygiene-blocked다. 이유인 unsponsored_surface(auth-api.ts)는 MAINTAINERS.md상 보안 리뷰 후 maintainer-sponsored가 필요하다. types/config 분할이나 중복 닫기 대상은 아니다.

라인 - src/codex/warmup.ts FALLBACK_MODELS / isRetryableWarmupStatus — 400·404 재시도와 luna 추가는 #4126 재현과 맞다. Free에서 5.5가 거절된다는 보고가 있으면 순서를 luna 우선으로 바꿀지 판단이 남는다.

라인 - src/codex/warmup.ts 폴백 루프 — 재시도 불가 status·비-CodexWarmupError를 즉시 throw하는 쪽이 HEAD보다 안전하다. 이 부분은 유지하는 편이 좋다.

라인 - src/codex/auth-api.ts verifyCodexAccountWarmup — 400/404 문구 분리는 맞지만 응답 HTTP status는 여전히 401이다. UI/클라이언트가 status만 보면 재인증 경로로 남을 수 있다. #4144의 429 분기와 같은 파일에서 겹친다.

경로/심볼 - docs-site 8로케일 codex-integration.md — 워밍업 문단만 동기화. 내용 자체는 코드와 맞다.

경로/심볼 - 라벨·CI — intake: hygiene-blocked / unsponsored_surface. 스폰서 없이 머지하면 안 된다.

경로/심볼 - #4144 — 같은 auth/warmup 표면의 열린 PR. 머지 순서·리베이스 합의가 필요하다.

메인테이너의 판단이 필요한 지점

  • #4144와 이 PR 중 어느 쪽을 먼저 스폰서·랜딩할지(둘 다 auth-api.ts 실패 문구 축)
  • 400/404 실패 응답을 401로 둘지, 별도 status/code로 나눌지
  • Free 계정 warmup 폴백 순서를 gpt-5.6-luna 우선으로 바꿀지
  • 스폰서 전 Cross-platform CI green만 요구할지, Free 실계정 한 번 더 확인할지

너의 추천
방향은 채택한다. #4126을 닫는 올바른 범위의 버그픽스다. 다음만 하고 머지 후보로 올린다: (1) 메인테이너가 보안 리뷰 후 maintainer-sponsored 부착, (2) #4144와 충돌 구간을 한쪽에 흡수하거나 이 PR 위에 429 분기를 이어 붙일지 정하기, (3) 가능하면 Free 경로에서 luna를 더 앞에 두거나 5.5 실패를 예상한 순서로 정리, (4) 응답 status를 401로 둘지 문구와 함께 재검토. 등록 검증 자체를 끄거나 404를 성공으로 취급하지는 않는다. hygiene 통과 전 머지 금지.

이 댓글은 grok-bot이 작성했습니다

@github-actions github-actions Bot removed the intake: hygiene-blocked Deterministic PR hygiene checks failed label Sep 10, 2026
@chilung-cgu
chilung-cgu marked this pull request as ready for review September 10, 2026 08:26
@github-actions
github-actions Bot marked this pull request as draft September 10, 2026 08:27

@Ingwannu Ingwannu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 404-to-next-model path addresses the reported warmup gap, and stopping on a nonretryable error inside the fallback loop is important now that there is more than one fallback. However, the new 401 test exercises only the primary attempt; that branch already aborted before this change.

Please add a primary 400/404 followed by fallback 401, 429, and 5xx matrix asserting no later model request, plus exhaustion/cancellation controls. These should observe outgoing attempt count and the final typed error, not just a helper predicate. Keep the reporter's successful Luna control distinct from a guarantee that every Free account is entitled to it. The new auth-api diagnostic also needs an assertion through that caller. This is a bounded review comment; required exact-head product CI is not established by the listed focused run.

@lidge-jun

Copy link
Copy Markdown
Owner

Landed via #4230 at ad36a59

@lidge-jun

Copy link
Copy Markdown
Owner

Superseded by maintainer landing #4230 on dev (ad36a59).

@lidge-jun lidge-jun closed this Sep 10, 2026
@lidge-jun lidge-jun added the landed-via-maintainer Original PR closed after landing via a maintainer merge train label Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working landed-via-maintainer Original PR closed after landing via a maintainer merge train

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants