Skip to content

improve(codex): guard native discovery against model-name restrictions - #132144

Merged
steipete merged 1 commit into
mainfrom
steipete/model-handling-codename-c0cdee
Aug 28, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/model-handling-codename-c0cdee

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #127322 (native-account discovery for unlisted models), #127394 (discovery before auth preparation).

Additional instructions

Maintainers can update this same-repository branch.

What Problem This Solves

The Codex harness's positive native-discovery tests only exercised GPT-shaped model names. A regression that restricted discovery eligibility to a gpt- prefix would pass those tests while rejecting opaque model identifiers.

Why This Change Was Made

Table-drive the two existing discovery cases with gpt-future and umbreon-latest. The latter is an opaque model-ID fixture that checks eligibility both with harness-owned authentication and before authentication has been prepared. Keep the existing rejection cases for automatic runtime selection, authored endpoints, and owner-selected credentials unchanged.

This strengthens coverage of the existing model-agnostic owner boundary; it does not add a model, change account entitlement, or alter runtime behavior. Codex's supplied-model contract preserves the provided string: rust-v0.150.1, models-manager/src/manager.rs:153–183.

User Impact

No user-visible behavior change. The tests now guard native model discovery against accidental model-name prefix restrictions. Production code, model catalogs, configuration, and dependencies are unchanged.

Evidence

  • node scripts/run-vitest.mjs extensions/codex/harness.test.ts extensions/codex/src/app-server/models.test.ts extensions/codex/src/app-server/model-catalog.test.ts — 69 tests passed across 3 files.
  • node scripts/check-changed.mjs -- extensions/codex/harness.test.ts — formatting, extension test types, targeted lint, and selected guards passed.
  • Mutation check: temporarily required a gpt- prefix at the existing eligibility predicate. Both opaque-ID cases failed while both GPT-shaped cases passed. Removed the mutation and reran the full focused proof above.
  • git diff --check — passed.
  • AI-assisted. Codex autoreview reported no accepted/actionable P0 findings.
  • Production LOC: +0/-0. Tests: +30/-24, net +6.

No live inference or UI proof is claimed: this is a test-only change, and the identifiers are test inputs rather than live model probes.

@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 28, 2026 21:45
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 28, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 28, 2026
@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 5:53 PM ET / 21:53 UTC.

ClawSweeper review

What this changes

The PR table-drives two Codex native-discovery tests so both a GPT-shaped and opaque model identifier must remain eligible when native discovery owns authentication.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: this maintainer-labelled PR is a focused test-only guard, but the required direct sibling Codex-source check is unavailable in this review environment, so no merge verdict is warranted.

Priority: P3
Reviewed head: 955964822e487d4b5034a513f410dbbdd7234bfe

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The small test change is coherent, but direct verification of the Codex contract that motivates it remains unavailable.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR changes only the harness regression test; it does not alter the production discovery owner. The captured PR body reports focused test and mutation evidence, but read-only review did not execute it.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR changes only the harness regression test; it does not alter the production discovery owner. The captured PR body reports focused test and mutation evidence, but read-only review did not execute it.
Evidence reviewed 5 items Introduced scope: The verified merge-base-to-head diff changes only the harness test, expanding each existing positive case from one model ID to two.
Current eligibility owner: Current main permits any nonempty trimmed model ID under the tightly bounded native-account conditions; it contains no model-name prefix rule.
Discovery path: The registered harness loads the native model catalog, which calls the Codex app-server model/list operation and retains each returned model ID for catalog entries.
Findings None None.
Security None None.

How this fits together

The bundled Codex plugin decides whether an explicitly selected OpenAI model can be discovered by the native Codex account before generic provider routing rejects it. That eligibility result enables the app-server model catalog and eventual session startup.

flowchart LR
  A[Explicit OpenAI model] --> B[Codex harness eligibility]
  B --> C{Native account owns discovery?}
  C -->|Yes| D[Codex app-server model list]
  C -->|No| E[Provider route checks]
  D --> F[Codex session startup]
  E --> F
Loading

Before merge

  • Resolve merge risk (P1) - A reviewer with the required sibling Codex source checkout must verify the model-string contract before treating this coverage change as merge-ready; this sandbox could not perform that check.
  • Complete next step (P2) - The maintainer label keeps this PR on the human review path, and the missing required Codex-source inspection is not an automated repair task.
Agent review details

Security

None.

PR surface

Tests +6. Total +6 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 30 24 +6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 30 24 +6

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; tests +30/-24 (net +6) The branch changes only focused regression coverage and adds no runtime, configuration, catalog, or dependency surface.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the compact table-driven regression guard after a reviewer directly verifies Codex’s supplied-model handling and exact-head CI completes.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the compact table-driven regression guard after a reviewer directly verifies Codex’s supplied-model handling and exact-head CI completes.

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

Not applicable: this PR protects against a hypothetical future prefix restriction rather than reporting a currently reproducible runtime failure.

Is this the best way to solve the issue?

Unclear: extending the two existing positive cases is the narrowest maintainable guard, but the Codex model-string contract could not be directly inspected here.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5b605da38946.

Labels

Label changes:

  • add P3: This is low-risk preventive test coverage with no introduced production behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR changes only the harness regression test; it does not alter the production discovery owner. The captured PR body reports focused test and mutation evidence, but read-only review did not execute it.

Label justifications:

  • P3: This is low-risk preventive test coverage with no introduced production behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR changes only the harness regression test; it does not alter the production discovery owner. The captured PR body reports focused test and mutation evidence, but read-only review did not execute it.

Evidence

What I checked:

Likely related people:

  • pash-openai: The related merged PRs that introduced the protected native discovery behavior were authored by this account. (role: merged native-discovery feature author; confidence: medium; commits: 264cc9940529, 4573635c77f9; files: extensions/codex/harness.ts, extensions/codex/src/app-server/model-catalog.ts)

Rank-up moves

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

  • Inspect the referenced Codex model-management source from the required sibling checkout, then complete normal exact-head CI review.

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 commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Land-ready verification for 955964822e487d4b5034a513f410dbbdd7234bfe.

The change closes a coverage gap in native discovery eligibility: both prior positive cases used a GPT-shaped identifier. The table-driven cases now also exercise an opaque ID in the harness-auth and pre-auth states. Runtime logic, account entitlement, model catalogs, and configuration are unchanged. Production LOC: +0/-0; tests: +30/-24 (net +6).

Validation:

  • node scripts/run-vitest.mjs extensions/codex/harness.test.ts extensions/codex/src/app-server/models.test.ts extensions/codex/src/app-server/model-catalog.test.ts — 69/69 passed.
  • node scripts/check-changed.mjs -- extensions/codex/harness.test.ts — selected formatting, test types, lint, and guards passed.
  • git diff --check — passed.
  • Mutation proof: a temporary GPT-prefix restriction failed exactly the two added cases while the two original cases still passed; the restriction was removed before the full focused rerun.
  • Fresh Codex autoreview — no accepted/actionable P0 findings.
  • Exact-head CI run 33213903530 passed: 56 successful jobs, 19 scope-disabled skips, no failures or cancellations. The required openclaw/ci-gate is green.
  • Native scripts/pr review-validate-artifacts 132144 passed with zero findings.

Live inference and UI proof are not applicable to this test-only change; none is claimed.

ClawSweeper follow-up and landing disposition

The completed review found no code or security defects. Its remaining items concern direct upstream-source access unavailable in the review sandbox and maintainer disposition.

Direct source verification is complete: the lead personally read the sibling Codex checkout at rust-v0.150.1 (90854393966b21e9ebfd21b122334eb09a20c93d). models-manager/src/manager.rs:153–183 preserves the supplied model string; app-server-protocol/src/protocol/v2/model.rs:92–120 declares string model identifiers. These are direct local source checks, not an inference from the PR description or generated OpenClaw types. The landing worker independently performed the same checks.

Disposition under the maintainer's explicit landing request: retain this compact table-driven coverage. The source-verification and exact-head-CI Rank-up move is satisfied; there is no production change or remaining actionable finding requiring a rewrite. This disposition does not claim that either fixture is a real model or establish account entitlement.

@steipete
steipete merged commit a79e651 into main Aug 28, 2026
193 checks passed
@steipete
steipete deleted the steipete/model-handling-codename-c0cdee branch August 28, 2026 22:04
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant