Skip to content

fix(update): migrate retired Codex routes without losing the subscription billing path - #145305

Merged
steipete merged 10 commits into
mainfrom
steipete/upd-codex-route-migration
Sep 12, 2026
Merged

steipete merged 10 commits into
mainfrom
steipete/upd-codex-route-migration

Conversation

@steipete

@steipete steipete commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #145154

Additional instructions

This branch is in openclaw/openclaw; maintainers with repository write access can edit it directly.

What Problem This Solves

Fixes an issue where users upgrading with both ChatGPT OAuth and an OpenAI API key could have heartbeat and subagent traffic silently move onto metered API billing. A custom official Completions adapter already existed in working 7.x subscription configurations; treating that adapter alone as an API billing pin changed shipped behavior. Deferred retirement could also leave a model that had retired on the subscription route, causing credential preparation to fall back to the API key.

Why This Change Was Made

The OpenAI plugin keeps subscription routing eligible for supported models and supplies an authentication preference. Shared selection applies it only to automatic selection with both credential kinds eligible. Explicit consumer pins, provider auth, provider-bound profiles, and authored auth order retain priority. Unpinned auxiliary consumers inherit the primary model's prepared intent as a preference. Runtime compatibility, implicit runtime selection, and explicit Codex runtime pins retain their existing semantics.

Two optional fields extend the existing beta-only Plugin SDK contract: ProviderResolveModelRoutesContext.routeIntent carries secret-free prepared consumer intent and its explicit/inherited source; ProviderModelRouteResolution.preferredAuthRequirement carries the provider-owned preference. Runtime preparation, availability, simple completion, and auxiliary selection consume those facts consistently. These additive changes need no beta-only compatibility shim or removal obligation. They introduce no user option, raw credentials, or hook. Simple completion uses the shared prepared account sequence and preserves same-route refresh fallback.

Doctor compares resolved billing routes around model-reference migration and names the consumer, model, profiles, and both billing routes after a successful config write. The existing Doctor result forwards those warnings into the diagnostic log and update ledger. Completed migrations do not repeat the warning. Model retirement preserves an agent's local runtime pin over inherited successor settings.

Package-swap Doctor now records deferred model retirement in the existing update ledger. The candidate completes that work after plugin convergence even when the published parent's freshDoctorRequired flag is false because no plugin changed. Candidate resume finishes the missing pass before publishing its result to the old parent; changed plugins keep the parent's existing guaranteed Doctor pass. Doctor marks the receipt complete only after the repaired config is durable. Deferral and completion are separate warning events, so the existing bounded update status summary shows completion after the package warnings. Rehearsal cannot borrow the real Doctor's ledger correlation.

Data-model compatibility: readers use existing model selectors/profile suffixes, aliases/runtime policies, auth profile declarations/order, provider auth/key settings, and canonical auth-store profiles. The SDK fields and Doctor completion flag are in-process facts. Writes remain model-reference/allowlist repairs plus existing diagnostic/update-run rows. The retained finalize:doctor:model-retirement row uses existing skipped/completed states; a normal warning row reports its outcome. Database schemas, credential encoding, ledger encoding, retention rules, recovery rules, and protocol versions are unchanged. Older readers already accept these step names/statuses; older plugins may omit the optional SDK fields.

Related to #145043 by @fuller-stack-dev, which addresses broader plugin migration ordering and preservation of legacy inputs. This PR owns authentication-route preference and explicit-auth precedence, plus completion of the specifically recorded model-retirement deferral. Their integration overlap is Doctor/update ordering; neither has been shown to supersede the other. No code was ported from #145043.

User Impact

An API key kept for another capability no longer silently takes priority over eligible subscription credentials. Explicit API choices still work, and single-kind authentication retains its selection behavior. Heartbeat profile pins reach admission without changing the normal chat session's selected account. Inheritance handles aliases, bare IDs, profile suffixes, and accounts declared only in the auth store. Subscription billing can use the ChatGPT route through an eligible OpenClaw runtime; choosing subscription credentials does not implicitly install Codex.

Thanks to @dbraendle for reporting the billing impact and configuration shape.

Evidence

Resolution path Synthetic heartbeat outcome
Released 2026.7.1-2 routing/auth owners Official endpoint defaults to Codex; available OAuth precedes API-key auth
Baseline main and compiled Doctor openai/gpt-5.4-mini selects openai:default / metered Completions
Repaired model-reference resolver openai/gpt-5.4-mini selects openai:chatgpt-default / subscription ChatGPT route
Repaired retirement owner Retires the subscription model to openai/gpt-5.6-luna; required OAuth availability succeeds

The original subscription probe failed before the repair with AssertionError: migration must preserve subscription billing, actual api-key, expected subscription. It passes on the current source. The three precedence regressions failed on 7ef41bf08ee8928ec87812e7af147a91d26b221b: provider auth produced an incompatible-route error; provider-bound API availability was false; API-first auth order selected OAuth. All pass after the corrections.

The published-driver cell at 31f683109c6 then found the deferred-retirement gap: the update succeeded and recorded billing warnings, but the retained gpt-5.4-mini failed required OAuth preparation as retired; automatic preparation selected the API profile. A manual second Doctor repaired it, which was correctly not counted as a passing update cell.

Failing-first tests for the new repair were captured before implementation on merged baseline cc5715f781a:

recorded deferred retirement, driver flag false:
expected beforeDoctor to be called once, but got 0 times

package-swap deferral:
expected undefined to match object { status: 'skipped' }

After implementation, 128 focused Doctor/update/canary/lease tests and 331 routing/migration tests passed through node scripts/run-vitest.mjs. After the final review correction, all 76 affected CLI/Doctor tests passed again. A later main merge introduced a required producer assessment; keeping produced and completed plugin results separate fixed the resulting CI type error without a cast or weakened producer contract. The merged head passed 131 focused owner tests, the final six Doctor tests, and the scoped changed-file gate including production/test types, lint, dead exports, and import-cycle guards. Coverage includes the published parent's missing run ID, rehearsal isolation, required OAuth availability after retirement, no-op completion, and refused writes retaining the pending receipt. The human-status regression also failed before the final event-ordering fix (completion was hidden behind the three package warnings), then passed with all 46 focused report/Doctor/completion tests and the scoped changed-file gate. The source subscription-preference probe still exits 0 with openai:chatgpt-default and openai-chatgpt-responses.

node scripts/check-changed.mjs passed format, ratchets, Doctor contracts, all production/test typechecks, all dead-export scans, and core lint. Extension lint stopped at the existing ancestor-install isolation guard (node_modules/punycode); the guard and ancestor installation were not changed. The Linux cell runs clean core and extension lint plus the canonical full package build.

pnpm plugin-sdk:surface:check passed after merging main, with no cap changes in this PR: public entrypoints 153/153, public exports 4454/4454, callable exports 2632/2632, wildcard reexports 50/50, deprecated exports 1132/1138.

Current head: 1d2ba49355e088d9f78beac91bf40af6a8d16657, including main b9eda7cd386568c677c9fcaf0fb27b33cb5c79f3. The initial deferred-retirement commit was production +105/-3, tests +213/-1, documentation +2/-0. Final PR diff against this merged main: production +988/-229, tests +1601/-195, docs +52/-1, and one exact shrink-only guard-data edit (+1/-1).

Published-2026.9.4 → candidate Linux cell passed at the deferred-retirement proof head 5167a545581c74d16253e1f20005504ee0473fe1: Testbox run 34675674426, isolated state, Node 24.19.0. The published npm-installed CLI ran update --tag file:<candidate.tgz> --yes --json --no-restart; the canonical candidate build and both Linux lint checks passed. The old parent reported plugins.changed=false. Both complete synthetic account values and explicit config auth choices were preserved. Candidate Doctor retired heartbeat/subagents to openai/gpt-5.6-luna; automatic heartbeat, subagents, and required-OAuth preparation selected openai:chatgpt-default / openai-chatgpt-responses, while the explicit API control selected openai:default / openai-completions.

The completed update contains finalize:doctor:model-retirement and warning:finalize:doctor:model-retirement, both completed. Human update status shows Deferred model retirement repair completed after plugin convergence. The published driver also retained both consumer-specific billing warnings as warning:openclaw doctor and warning:openclaw doctor:2. A repeat doctor --fix --non-interactive exited 0, emitted zero fresh billing events/panels, and preserved the entire update receipt plus agents/auth config. Historical warnings remain visible in Update history. Task evidence: .local/l103-cell/attempt-7/summary.json and its artifacts directory; the owned lease was stopped after collection.

Exact-head CI for 1d2ba49355e088d9f78beac91bf40af6a8d16657: passed, run 34677085403. No rerun was needed; the previously reported lint-cap and worker-launch lanes passed. The final environment-precedence delta passed node scripts/check-changed.mjs -- src/agents/model-auth-availability.ts src/agents/runtime-plan/prepare-auth.ts src/agents/runtime-plan/prepare-auth.route-intent.test.ts src/agents/runtime-plan/prepare-auth.test.ts docs/plugins/sdk-provider-plugins/runtime-hooks.md, including typechecks, lint, ratchets, dead exports, and import/storage guards.

Review follow-ups

ClawSweeper review

Reviewed head: 1d2ba49355e088d9f78beac91bf40af6a8d16657. The exact-head review reports no actionable code or security findings. The earlier explicit auth, apiKey, provider-bound profile, authored auth.order, and environment-fallback precedence findings are fixed and covered by the shared cross-path regression table.

The maintainer accepts the documented automatic subscription preference; integrations requiring metered API billing retain explicit authentication controls. The two optional Plugin SDK fields are additive and require no version bump. There is no new configuration option or stored config shape, database schema, retention, recovery, or protocol change.

The published-driver qualification is retained for the unchanged deferred-retirement path at 5167a545581c74d16253e1f20005504ee0473fe1; the final auth-only correction has separate failing-first owner coverage and exact-head green CI. Live inference, Gateway restart, and the optional empty-account updater variant are skipped as disclosed proof limits, not claimed as passing. The linked Testbox workflow envelope is cancelled; qualification rests on the preserved cell observations described above, not its workflow conclusion. The data-model follow-up is satisfied by the compatibility statement and published-driver observations above. No new code fixup or re-review request is needed for this disposition.

Configured auth with environment fallback: both auth owners now retain an explicit provider auth mode when OPENAI_API_KEY supplies fallback material. The new regression failed on 5167a545: preparation and availability both chose openai:chatgpt-default / subscription despite auth: "api-key"; both now choose openai:default / API-key. The shared six-row table runs explicit provider auth, provider-bound profile, auth.order, inherited intent, unconfigured environment fallback, and configured auth plus environment fallback through both owners with identical expected outcomes. Two prior OAuth tests were tightened to preserve explicit OAuth or reject incompatible explicit profile order; both also failed before the fix. The four owner suites pass 165 tests, the subscription-default probe still passes, and a fresh P1 autoreview is scoped-clean for this delta.

SDK precedence risk: the routeIntent / preferredAuthRequirement documentation now states the ordering across preparation and availability. Required bindings and configured auth remain authoritative; authored auth order ranks eligible profiles; inherited intent/provider preference only breaks remaining ties. Environment credentials do not clear configured auth. The SDK surface check passes with the unchanged counts above.

Published-updater qualification: the successful Linux cell, run 34675674426, qualifies the deferred-retirement implementation at 5167a545581c74d16253e1f20005504ee0473fe1. Its exact orchestration was node .local/l103-cell/invoke.mjs --run --attempt attempt-7 --id tbx_01m2a1dfrcczpm4dctrv2dtpfk --head 5167a545581c74d16253e1f20005504ee0473fe1; the published 2026.9.4 CLI ran update --tag file:<candidate.tgz> --yes --json --no-restart. With plugins.changed=false, both accounts survived, finalize:doctor:model-retirement completed, human update status displayed completion, and heartbeat/subagents selected the subscription profile with the API key present. Repeat Doctor preserved the completed receipt and emitted no fresh billing warning. The new delta changes auth precedence only; this cell has not been rerun for it. The optional no-existing-accounts updater variant remains unrun because the exact compiled artifact and lease are no longer available; the two-profile table is not empty-account proof.

Data-model compatibility: see the Data-model compatibility paragraph above and the two optional SDK fields. This follow-up changes only in-process selection conditions, tests, and precedence documentation. It adds no stored shape or schema and no compatibility burden for older readers.

Known limits: the reporter's redacted backups have not arrived, so their precise configuration and release chronology remain unverified. The released routing helper was executed and its auth owner inspected; the whole 7.x updater was not run. Doctor enumerates primary, heartbeat, subagent, and explicitly authored model consumers; other inherited auxiliary capability defaults are not separately enumerated. Proof uses synthetic credentials and does not claim successful live provider inference or Gateway restart.

@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes commands Command implementations agents Agent runtime and tooling extensions: openai size: XL maintainer Maintainer-authored PR labels Sep 11, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 11, 2026
@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 12, 2026, 2:09 AM ET / 06:09 UTC (Revision 13).

ClawSweeper review

What this changes

The PR preserves subscription billing during automatic OpenAI account selection and model migrations, honors explicit authentication choices, and completes deferred model retirement after updates.

Merge readiness

⛔ Blocked before merge - 3 items remain

The previous configured-auth blocker is fixed, and no remaining blocking defect was found. Current main and v2026.9.4 still retain the affected routing behavior; the related update PR does not supersede this work.

Priority: P1
Reviewed head: 1d2ba49355e088d9f78beac91bf40af6a8d16657

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful repair with substantial upgrade evidence and the prior blocker resolved; remaining coverage limits are explicitly disclosed.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The matching complete PR body records the published 2026.9.4 updater exercising candidate Doctor and route-selection owners on isolated Linux state, preserving both accounts and selecting subscription billing after retirement. That unchanged update path remains covered at 5167a54; the final authentication-only correction has separate failing-first owner coverage. Proof does not establish live inference or restart.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The matching complete PR body records the published 2026.9.4 updater exercising candidate Doctor and route-selection owners on isolated Linux state, preserving both accounts and selecting subscription billing after retirement. That unchanged update path remains covered at 5167a54; the final authentication-only correction has separate failing-first owner coverage. Proof does not establish live inference or restart.
Evidence reviewed 10 items Previous blocker resolved: The exact-head commit preserves configuredAuthMode when environment fallback material exists in both preparation and availability. Its regression table exercises both owners with explicit API authentication, eligible API/OAuth profiles, and OPENAI_API_KEY without an inherited profile constraint.
Shared precedence and credential boundaries: Provider preference applies only after required bindings, configured authentication, explicit ordering, readiness, and cooldown filtering. Credential materialization retains exact-route checks and stops on terminal secret or OAuth refresh failures.
Durable update completion: Deferred retirement uses existing update-ledger steps. Candidate resume runs the missing Doctor pass when plugins are unchanged, and completion is recorded after successful config persistence; regression coverage retains pending status when the write is refused.
Findings None None.
Security None None.

How this fits together

OpenAI provider policy supplies available billing routes, and shared authentication preparation selects eligible accounts for chat, heartbeat, subagent, and auxiliary requests. Doctor repairs configured model references and records migration outcomes during updates.

flowchart TD
  A[Model and account settings] --> B[OpenAI route policy]
  C[Eligible credentials] --> D[Shared account selection]
  B --> D
  D --> E[Compatible agent runtime]
  A --> F[Doctor model migration]
  F --> G[Saved config and update notices]
  G --> A
Loading

Before merge

  • Resolve merge risk (P1) - The additive SDK preference contract intentionally changes automatic mixed-credential selection for official Completions configurations; integrations relying on API billing must express that choice through the documented authentication controls.
  • Resolve merge risk (P1) - Upgrade observations cover synthetic mixed credentials on Linux; live provider inference, Gateway restart, and the optional empty-account updater variant were not demonstrated.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +759, Tests +1406, Docs +51, Other 0. Total +2216 across 63 files.

View PR surface stats
Area Files Added Removed Net
Source 38 988 229 +759
Tests 21 1601 195 +1406
Docs 3 52 1 +51
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 63 2642 426 +2216

Review metrics

Metric Value Why it matters
Plugin contract additions 2 optional fields; 0 new hooks or user settings The change extends the existing route contract without requiring older plugins to supply new fields.
Precedence parity coverage 6 scenarios checked through 2 authentication owners The shared table covers preparation and availability together, including the exact previously reported environment-fallback defect.

Stored data model

Persistent data-model change detected: migration/backfill/repair: config/assertion-safety-baseline.txt, migration/backfill/repair: src/cli/program/config-guard.ts, migration/backfill/repair: src/cli/update-cli/update-command-fresh-doctor.ts, migration/backfill/repair: src/cli/update-cli/update-command-resume.ts, migration/backfill/repair: src/commands/doctor-config-flow.ts, migration/backfill/repair: src/commands/doctor-config-preflight.ts, and 12 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #145154
Summary: This PR is the candidate repair for the reported billing migration; the other update PR overlaps only in Doctor/update ordering.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Retain the documented precedence contract (recommended)
    Accept the intentional automatic subscription preference with explicit authentication controls preserved and the recorded published-updater qualification retained.

Technical review

Best possible solution:

Maintain one shared authentication-precedence contract, preserve explicit account choices, and keep migration notices tied to durable Doctor writes.

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

Yes, from source: official Completions configuration with both account types exposes the baseline API-only selection, and the PR records a failing subscription-preservation probe. This review did not execute the reproduction.

Is this the best way to solve the issue?

Yes. Provider-owned route preference consumed by shared authentication selection is a maintainable repair, and the latest correction preserves explicit provider authentication in both preparation and availability.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against d5e652099074.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The matching complete PR body records the published 2026.9.4 updater exercising candidate Doctor and route-selection owners on isolated Linux state, preserving both accounts and selecting subscription billing after retirement. That unchanged update path remains covered at 5167a54; the final authentication-only correction has separate failing-first owner coverage. Proof does not establish live inference or restart.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 auth-provider: Current PR review merge-risk labels are merge-risk: 🚨 compatibility.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: The linked report describes real heartbeat and subagent traffic silently incurring metered charges after an upgrade.
  • merge-risk: 🚨 compatibility: The optional Plugin SDK fields change automatic route preference while preserving documented explicit authentication choices.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The matching complete PR body records the published 2026.9.4 updater exercising candidate Doctor and route-selection owners on isolated Linux state, preserving both accounts and selecting subscription billing after retirement. That unchanged update path remains covered at 5167a54; the final authentication-only correction has separate failing-first owner coverage. Proof does not establish live inference or restart.
  • proof: sufficient: Contributor real behavior proof is sufficient. The matching complete PR body records the published 2026.9.4 updater exercising candidate Doctor and route-selection owners on isolated Linux state, preserving both accounts and selecting subscription billing after retirement. That unchanged update path remains covered at 5167a54; the final authentication-only correction has separate failing-first owner coverage. Proof does not establish live inference or restart.

Evidence

What I checked:

  • Previous blocker resolved: The exact-head commit preserves configuredAuthMode when environment fallback material exists in both preparation and availability. Its regression table exercises both owners with explicit API authentication, eligible API/OAuth profiles, and OPENAI_API_KEY without an inherited profile constraint. (src/agents/runtime-plan/prepare-auth.ts:423, 1d2ba49355e0)
  • Shared precedence and credential boundaries: Provider preference applies only after required bindings, configured authentication, explicit ordering, readiness, and cooldown filtering. Credential materialization retains exact-route checks and stops on terminal secret or OAuth refresh failures. (src/agents/provider-model-route-auth.ts:361, 1d2ba49355e0)
  • Durable update completion: Deferred retirement uses existing update-ledger steps. Candidate resume runs the missing Doctor pass when plugins are unchanged, and completion is recorded after successful config persistence; regression coverage retains pending status when the write is refused. (src/flows/doctor-health-contribution-runners.config.ts:308, 1d2ba49355e0)
  • Complete captured proof body inspected: The fetched full body matched the supplied 13,907-unit snapshot and SHA-256 7a26fbf98af719cb9b4e1f39b551bb2cecb627618e3205dec03878c69a848961. It records a published-2026.9.4 Linux update into head 5167a54 with unchanged plugins, preserved accounts, subscription-selected auxiliary consumers, an explicit API control, visible retirement completion, and idempotent repeat Doctor. The final auth-only delta has separately reported failing-first regressions and 165 passing owner tests. (1d2ba49355e0)
  • Proof scope: The linked Testbox workflow envelope reports cancelled, so its status is not treated as a passing assertion. The assessment uses the preserved cell observations in the matching PR body, which explicitly disclose synthetic credentials, no live inference or restart, and no updater rerun for the final authentication-only delta. (5167a545581c)
  • Still necessary on main and latest release: Direct GitHub source reads at fetched main and v2026.9.4 show authored official Completions remaining an API-only route; neither contains this branch's legacy-Completions subscription preference. The linked issue remains open, and the separate update PR remains an overlapping implementation rather than a merged replacement. (extensions/openai/provider-policy-api.ts:392, d5e652099074)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • fuller-stack-dev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

History

Review history (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-12T00:50:49.457Z sha 7ef41bf :: blocked before merge. :: [P1] Preserve configured provider auth before filtering inherited routes | [P1] Resolve provider-bound credentials before availability filters routes | [P1] Keep inherited billing intent subordinate to explicit auth order
  • reviewed 2026-09-12T01:52:25.838Z sha 31f6831 :: blocked before merge. :: [P1] Preserve configured auth when an environment fallback is present
  • reviewed 2026-09-12T03:22:09.558Z sha 31f6831 :: blocked before merge. :: [P1] Preserve configured auth when an environment fallback is present
  • reviewed 2026-09-12T04:12:22.194Z sha bcb13b4 :: blocked before merge. :: [P1] Preserve configured auth when an environment fallback is present
  • reviewed 2026-09-12T04:50:27.982Z sha 4e5c764 :: blocked before merge. :: [P1] Preserve configured auth when an environment fallback is present
  • reviewed 2026-09-12T05:35:22.491Z sha 5167a54 :: blocked before merge. :: [P1] Preserve configured auth when an environment fallback is present
  • reviewed 2026-09-12T05:49:58.079Z sha 5167a54 :: blocked before merge. :: [P1] Preserve configured auth when an environment fallback is present
  • reviewed 2026-09-12T05:57:02.674Z sha 5167a54 :: blocked before merge. :: [P1] [P1] Preserve configured auth when an environment fallback is present

@steipete
steipete force-pushed the steipete/upd-codex-route-migration branch from 2b2076d to b3700c9 Compare September 11, 2026 21:39
@steipete
steipete marked this pull request as ready for review September 11, 2026 21:41
@steipete
steipete requested a review from a team as a code owner September 11, 2026 21:41
Preserve default route intent for aliases, bare IDs, and stored-profile
bindings. Keep implicit Completions runtime selection independent of billing
preference, and retain a plain literal API key behind eligible profiles.

Refs #145154
Thanks to @dbraendle for reporting the mixed-credential billing regression.
Resolve provider auth and profile bindings before route filtering. Keep inherited billing intent subordinate to explicit credential order. Refs #145154.
@steipete steipete closed this Sep 12, 2026
@steipete steipete reopened this Sep 12, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 12, 2026
@steipete steipete changed the title fix(openai): keep subscription-routed models on the Codex route when an API key also exists fix(update): migrate retired Codex routes without losing the subscription billing path Sep 12, 2026
@steipete
steipete merged commit 8b5fa24 into main Sep 12, 2026
208 of 209 checks passed
@steipete
steipete deleted the steipete/upd-codex-route-migration branch September 12, 2026 06:37
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 13, 2026
…tion billing path (openclaw#145305)

Retired `openai-codex/*` routes migrate to `openai/*` without switching an unpinned heartbeat or subagent from the ChatGPT subscription to the metered API key. Explicit provider auth, provider-bound profiles, and authored auth order keep precedence; the deferred model-retirement Doctor pass completes on the candidate's own receipt.

The two optional Plugin SDK fields are additive, with no version bump or new configuration option, stored shape, schema, retention, or recovery change.

Validated by failing-first authentication regressions, published-driver deferred-retirement proof, and green exact-head CI. Live inference, Gateway restart, and the optional empty-account updater variant remain unproven.

Fixes openclaw#145154

Thanks to @dbraendle for reporting the billing regression.
steipete added a commit that referenced this pull request Oct 27, 2026
Complete post-plugin Doctor when updater-owned database writes change a captured generation. Carry settled Doctor postimages through the existing database-write receipt and migration lineage, and observe the updater-owned state database before finalization.

Close the retained update-run writer before observing its postimage so the next Doctor can acquire native SQLite exclusion. Preserve refusal for changes to untouched captured databases and the accepted native-close tradeoff for databases the updater writes.

Covers plugin changes, deferred model retirement, and deferred plugin migrations. Related: #174599 and #145305.

Validated by the real native update with config/auth migrations and completed deferred retirement, cross-process owner regression, and exact-head CI including all three PostgreSQL shards.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
…85789)

Complete post-plugin Doctor when updater-owned database writes change a captured generation. Carry settled Doctor postimages through the existing database-write receipt and migration lineage, and observe the updater-owned state database before finalization.

Close the retained update-run writer before observing its postimage so the next Doctor can acquire native SQLite exclusion. Preserve refusal for changes to untouched captured databases and the accepted native-close tradeoff for databases the updater writes.

Covers plugin changes, deferred model retirement, and deferred plugin migrations. Related: openclaw#174599 and openclaw#145305.

Validated by the real native update with config/auth migrations and completed deferred retirement, cross-process owner regression, and exact-head CI including all three PostgreSQL shards.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling cli CLI command changes commands Command implementations docs Improvements or additions to documentation extensions: openai gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

[Bug]: doctor/wizard migration silently reroutes Codex-OAuth traffic to paid API key when both auth profiles exist

1 participant