Skip to content

fix(openai): correct live model and packaged onboarding failures - #114288

Merged
steipete merged 1 commit into
mainfrom
codex/openai-onboarding-deep-stress
Jul 27, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/openai-onboarding-deep-stress

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #114258

What Problem This Solves

Fixes an issue where users onboarding with OpenAI could be offered models unavailable to their account, lose image input on GPT-5.4 Pro, or receive an invalid configuration immediately after installing the release package. The installed interactive onboarding path was also missing from beta and stable release acceptance.

Why This Change Was Made

Treat successful OpenAI and ChatGPT account-specific model catalogs as authoritative, including empty, hidden-model, and unauthorized responses, while preserving the static fallback for transient failures. Follow OpenAI's documented GPT-5.4 Pro image-input contract, emit canonical keyed agent and image-generation configuration, retain bounded secret-safe onboarding diagnostics, and run real typed package onboarding in release acceptance.

User Impact

Fresh and repeated OpenAI onboarding select models actually available to the user's account, preserve supported image input, keep secret references and Gateway credentials stable, and complete successfully from an installed release package without touching the operator's home. Beta and stable releases exercise interactive package onboarding before shipment.

Evidence

  • Started from latest fetched origin/main at 730b341f3fec14d17a2c763d696764031229b77c.
  • Trusted Blacksmith Testbox: 469 focused regression tests across 12 files, clean changed-file formatting, pnpm check:changed, pnpm build, all affected lint and typecheck lanes, and a fully validated npm release artifact.
  • Real OpenAI API completions from gpt-5.6, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.4-mini, gpt-5.4-nano, and chat-latest.
  • Two actual secret-reference onboarding runs, isolated workspace, stable generated Gateway credential, embedded first turn, real Gateway /readyz, authenticated Gateway health, and a real model-backed first Gateway turn.
  • Reproduced the installed-package failure: retired agents.defaults.imageGenerationModel invalidated the generated configuration. Proved the fix with pnpm test:docker:release-typed-onboarding against the freshly packed final npm artifact.
  • Regression coverage for empty, hidden, 401/403, and transient 503 model catalogs; canonical keyed agents and media models; beta, stable, non-live, and aggregate release scenarios.
  • Official model contract: https://developers.openai.com/api/docs/models/gpt-5.4-pro
  • Directly inspected Codex account/model-visibility ownership in ../codex/codex-rs/protocol/src/openai_models.rs and ../codex/codex-rs/app-server/src/models.rs.
  • Fresh independent autoreview: clean. TruffleHog: clean.
  • AI-assisted.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts docker Docker and sandbox tooling extensions: openai labels Jul 27, 2026
@steipete
steipete marked this pull request as ready for review July 27, 2026 04:40
@openclaw-barnacle openclaw-barnacle Bot added size: L maintainer Maintainer-authored PR labels Jul 27, 2026
@steipete

steipete commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Maintainer exact-head proof for f446c32e9d8852e0a89dfb03e3411ea750a6d354:

  • 469 focused provider, plugin SDK, onboarding fixture, Docker-helper, and release-planner regressions.
  • Full pnpm check:changed and pnpm build, including lint, production/test typechecks, public SDK, and packaged UI.
  • Freshly packed release artifact: pnpm test:docker:release-typed-onboarding passed with actual interactive installed-package onboarding.
  • Extra installed-package stress: pnpm test:docker:npm-onboard-channel-agent passed with OpenAI onboarding, Telegram activation, doctor repair, canonical model selection, and an actual agent response.
  • Actual OpenAI API completions for seven models, plus two isolated secret-reference onboardings, stable Gateway credentials, readiness, authenticated health, and a real Gateway-backed agent turn.
  • Reproduced the former installed-package failure and proved the canonical keyed-agent/media-model fix; covered empty, hidden, 401/403, and transient-failure model catalogs.
  • Personally verified account visibility against upstream Codex source and GPT-5.4 Pro image input against the official OpenAI model specification.
  • Fresh independent autoreview and TruffleHog are clean; validated native review artifacts report no findings.

@clawsweeper

clawsweeper Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 27, 2026, 12:46 AM ET / 04:46 UTC.

ClawSweeper review

What this changes

This PR makes OpenAI account model discovery authoritative for successful and authorization responses, corrects canonical onboarding fixture configuration, enables GPT-5.4 Pro image input, and adds packaged interactive-onboarding coverage to release acceptance.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep this PR open for explicit maintainer review. The supplied diff addresses concrete OpenAI onboarding and packaged-release regressions, includes focused regression coverage and credible real-environment evidence, and I found no discrete patch defect; the remaining gate is reviewing the account-authoritative catalog behavior on the current base before landing.

Priority: P1
Reviewed head: f446c32e9d8852e0a89dfb03e3411ea750a6d354
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong real-environment and package-artifact evidence supports a focused patch; a maintainer still needs to confirm the intentional authorization fallback policy on the final base.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body and exact-head follow-up describe real API completions, isolated secret-reference onboarding, a real Gateway first turn, and a freshly packed package scenario; the GitHub Real behavior proof check is successful.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body and exact-head follow-up describe real API completions, isolated secret-reference onboarding, a real Gateway first turn, and a freshly packed package scenario; the GitHub Real behavior proof check is successful.
Evidence reviewed 6 items Account-catalog behavior: The branch replaces the generic live-provider helper path with explicit OpenAI catalog handling: successful empty, unsupported-only, 401, and 403 responses yield no advertised account models, while transient discovery failures retain the manifest fallback. The accompanying tests cover those distinct outcomes.
Canonical onboarding configuration: The package-test fixture moves generated agent state from the retired list/image-generation shapes to keyed agents and mediaModels.image, matching the repository’s current canonical configuration direction.
Packaged-path coverage: The release typed-onboarding scenario is added to the package-install OpenAI release lanes, so the packed npm artifact’s interactive onboarding path is exercised rather than only source-checkout behavior.
Findings None None.
Security None None.

How this fits together

The OpenAI plugin discovers models visible to an authenticated account and supplies the catalog used by onboarding. Onboarding writes the agent/provider configuration that the installed CLI and Gateway use for the first model-backed turn, while release scenarios validate the packed npm artifact.

flowchart LR
  A[OpenAI credentials] --> B[Account model discovery]
  B --> C[OpenAI provider catalog]
  C --> D[Onboarding configuration]
  D --> E[Installed CLI]
  E --> F[Gateway first turn]
  D --> G[Release package acceptance]
Loading

Decision needed

Question Recommendation
Should OpenAI onboarding intentionally show no static model fallback when account discovery succeeds with an empty list or returns 401/403, after the branch is refreshed onto current main? Land after exact-head refresh: Refresh the branch against current main and confirm the provider and packed onboarding proofs retain the intended empty/401/403 behavior.

Why: This is an intentional provider-auth and user-selection policy boundary: tests can verify the implementation, but only an owner can confirm that suppressing fallback choices for those account states is the desired product contract.

Before merge

  • Resolve merge risk (P2) - Merging changes the behavior of authenticated OpenAI onboarding: empty or unauthorized model discovery now intentionally advertises no static fallback models, so the exact-head review should confirm that 401/403 handling matches the intended account-access contract after updating to current main.
  • Resolve merge risk (P1) - The PR is marked maintainer and its GitHub merge state is behind the current base; refresh the package-onboarding and provider checks on the final merge candidate rather than relying solely on the earlier exact-head run.
  • Complete next step (P2) - The remaining action is a maintainer-owned provider-auth policy confirmation and exact-head refresh, not a mechanical repair task.
Agent review details

Security

None.

PR surface

Source +8, Tests +311, Other +20. Total +339 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 1 67 59 +8
Tests 6 346 35 +311
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 5 61 41 +20
Total 12 474 135 +339

Review metrics

Metric Value Why it matters
Generated configuration paths 2 canonical paths adopted The package fixture now uses keyed agent entries and mediaModels.image, preventing release acceptance from validating a retired configuration shape.
Release acceptance coverage 1 package-install OpenAI lane added The installed interactive onboarding scenario now participates in the OpenAI package release plan rather than only the general lane set.

Stored data model

Persistent data-model change detected: serialized state: test/scripts/npm-onboard-channel-agent-assertions.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Refresh and prove the account-access policy (recommended)
    Update the branch to current main and rerun the focused provider plus packed onboarding scenarios so maintainers can land the intentional empty/401/403 catalog behavior with exact-head evidence.
  2. Accept static fallback on authorization errors
    If avoiding an empty model picker for stale or partially authorized credentials is more important, retain the manifest fallback specifically for 401/403 and preserve empty-success results as authoritative.

Technical review

Best possible solution:

Land a refreshed version of this focused OpenAI-plugin fix after an owner confirms the account-authoritative empty/401/403 catalog policy and the packed release-onboarding scenario passes against the final base.

Do we have a high-confidence way to reproduce the issue?

Yes in source and contributor evidence: the prior behavior falls back to static models through the shared live-provider path, while the branch adds explicit tests for empty, unsupported-only, 401, 403, and transient responses plus a packed onboarding scenario. I did not independently execute the live-key or packed-artifact reproduction in this read-only review.

Is this the best way to solve the issue?

Yes, subject to the maintainer policy choice on 401/403: keeping OpenAI-specific account visibility inside the OpenAI plugin and testing the packed onboarding path is narrower and more maintainable than adding a core fallback or runtime compatibility shim.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 71eb9a3ec9d9.

Labels

Label changes:

  • add P1: The PR repairs onboarding behavior that can prevent real OpenAI users from selecting account-available models or completing an installed-package first run.
  • add merge-risk: 🚨 auth-provider: The patch changes the model choices exposed after authenticated discovery and specifically changes 401/403 fallback behavior.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body and exact-head follow-up describe real API completions, isolated secret-reference onboarding, a real Gateway first turn, and a freshly packed package scenario; the GitHub Real behavior proof check is successful.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.

Label justifications:

  • P1: The PR repairs onboarding behavior that can prevent real OpenAI users from selecting account-available models or completing an installed-package first run.
  • merge-risk: 🚨 auth-provider: The patch changes the model choices exposed after authenticated discovery and specifically changes 401/403 fallback behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body and exact-head follow-up describe real API completions, isolated secret-reference onboarding, a real Gateway first turn, and a freshly packed package scenario; the GitHub Real behavior proof check is successful.

Evidence

What I checked:

  • Account-catalog behavior: The branch replaces the generic live-provider helper path with explicit OpenAI catalog handling: successful empty, unsupported-only, 401, and 403 responses yield no advertised account models, while transient discovery failures retain the manifest fallback. The accompanying tests cover those distinct outcomes. (extensions/openai/openai-provider.ts:245, f446c32e9d88)
  • Canonical onboarding configuration: The package-test fixture moves generated agent state from the retired list/image-generation shapes to keyed agents and mediaModels.image, matching the repository’s current canonical configuration direction. (scripts/e2e/lib/fixtures/mock-openai-config.mjs:61, f446c32e9d88)
  • Packaged-path coverage: The release typed-onboarding scenario is added to the package-install OpenAI release lanes, so the packed npm artifact’s interactive onboarding path is exercised rather than only source-checkout behavior. (scripts/lib/docker-e2e-scenarios.mjs:793, f446c32e9d88)
  • Model modality contract: The proposed GPT-5.4 Pro model metadata permits text and image input, consistent with the current official GPT-5.4 Pro model documentation. citeturn2view0. (extensions/openai/openai-provider.ts:234, f446c32e9d88)
  • Prior merged feature history: The closely related merged PR established the same OpenAI account-model discovery and onboarding path; this follow-up extends it with authorization/empty-catalog behavior and package-release acceptance coverage. (extensions/openai/openai-provider.ts:245, 04bb2b7ee9a9)
  • Real behavior proof: The PR body and exact-head comment report real OpenAI completions, two isolated secret-reference onboarding runs, Gateway readiness and first-turn verification, plus a freshly packed artifact run of the typed onboarding scenario. GitHub also reports the PR’s Real behavior proof check as successful. (test/openai-onboarding.live.test.ts:89, f446c32e9d88)

Likely related people:

  • steipete: The immediately preceding merged OpenAI account-model/onboarding PR touched this same provider and live-onboarding surface, and this follow-up builds directly on it. (role: recent OpenAI onboarding contributor; confidence: medium; commits: 04bb2b7ee9a9, f446c32e9d88; files: extensions/openai/openai-provider.ts, test/openai-onboarding.live.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Refresh onto current main and preserve exact-head provider and packaged-onboarding evidence.
  • Confirm that suppressing fallback models for 401/403 is the intended OpenAI onboarding contract.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 60aac74 into main Jul 27, 2026
204 of 207 checks passed
@steipete
steipete deleted the codex/openai-onboarding-deep-stress branch July 27, 2026 04:50
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Docker and sandbox tooling extensions: openai maintainer Maintainer-authored PR scripts Repository scripts size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant