fix(doctor): preserve runtime pins during codex route repair [AI-assisted]#84862
fix(doctor): preserve runtime pins during codex route repair [AI-assisted]#84862nxmxbbd wants to merge 1 commit into
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Keep open: the PR addresses the P1 doctor runtime-pin regression with solid terminal proof, but it is not merge-ready because the branch drops a current-main doctor warning/test for malformed Codex app-server command overrides and overlaps an existing ClawSweeper replacement branch. Canonical path: Close this PR as superseded by #84362. So I’m closing this here and keeping the remaining discussion on #84362. Review detailsBest possible solution: Close this PR as superseded by #84362. Do we have a high-confidence way to reproduce the issue? Yes for the core bug: the PR body includes before/after terminal matrix output, and source inspection shows current-main route repair can synthesize Is this the best way to solve the issue? No, not as submitted: the runtime-pin preservation approach is plausible and well covered, but the branch must restore the dropped app-server command warning/test before it is the narrowest maintainable fix. Security review: Security review cleared: No concrete security or supply-chain issue was found; the diff changes local doctor config repair logic and tests without new dependencies, workflows, permissions, network calls, or secret handling. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 908b894432c4. |
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Moonlit Proofling Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
|
@clawsweeper hatch |
|
🦞👀 I queued a comment sync for this PR. If the egg is hatchable, ClawSweeper will generate the image once and update the existing review comment. |
|
ClawSweeper could not hatch this PR egg yet. Reason: there is no current durable ClawSweeper review record for this PR, so there is no PR egg state record to update. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
ClawSweeper applied the proposed close for this PR.
|
Summary
openclaw doctor --fixcan rewriteopenai-codex/*routes to canonicalopenai/*while replacing an explicit non-defaultagentRuntimepin, such aspi, withcodex.gpt-5.5token-usage behavior discussed on [Bug]: doctor --fix silently migrates intentional openai-codex/ config to openai/, breaking PI+OAuth runtime and causing 3-4x token inflation #84038, and it does not editCHANGELOG.md.Motivation
#84362 is the ClawSweeper replacement for #84142, but that bot-owned branch is currently blocked by a
CHANGELOG.mdconflict. This PR provides the same fix path on currentupstream/main, deliberately avoiding the contributor-forbidden changelog edit, and includes the tested follow-up runtime-pin cases.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
openclaw doctor --fixroute repair preserves explicit non-default runtime pins when migratingopenai-codex/gpt-5.4toopenai/gpt-5.4.upstream/mainbranch with this patch applied.OPENCLAW_REPO=/tmp/openclaw-84038-clean-20260521 pnpm exec tsx /tmp/repro-openclaw-84038-runtime-pin-matrix.mjsTerminal output from the runtime resolver / doctor repair matrix:
openai-codex/*routes are rewritten to canonicalopenai/*, while explicitpiruntime pins remain effective for the repaired route. A listed agent that already explicitly uses canonical OpenAI with Codex routing keepscodexinstead of inheriting the repaired defaults-levelpipolicy.gpt-5.5token-usage behavior discussed in [Bug]: doctor --fix silently migrates intentional openai-codex/ config to openai/, breaking PI+OAuth runtime and causing 3-4x token inflation #84038.upstream/mainrepaired all four scenarios toagentRuntime.id = "codex"and ended withRED: one or more runtime pins were not preserved across doctor route repair.Root Cause (if applicable)
openai/*Codex runtime policy before considering explicit pre-repair non-default runtime pins from legacyopenai-codex/*model-map entries, provider-level policy, or provider catalog model policy.Regression Test Plan (if applicable)
src/commands/doctor/shared/codex-route-warnings.test.tsmaybeRepairCodexRoutesplus the runtime resolver exercises the doctor repair output and the effective runtime selection without needing a live provider credential.User-visible / Behavior Changes
openclaw doctor --fixstill canonicalizes legacyopenai-codex/*route refs, but now preserves explicit non-default runtime pins instead of silently moving those repaired routes onto Codex runtime.Diagram (if applicable)
Security Impact (required)
NoNoNoNoNoYes, explain risk + mitigation: N/ARepro + Verification
Environment
openai-codex/gpt-5.4repaired toopenai/gpt-5.4agentRuntime.id = "pi"in model-map, provider-level, and provider-catalog shapesSteps
upstream/mainand observe RED.Expected
openai/gpt-5.4routes preserve explicitpiruntime pins.Actual
Evidence
Verification commands run locally:
Results:
Human Verification (required)
auto/defaultruntime policy is not treated as an explicit pin; listed canonical agents keep Codex when defaults repair preserves PI; contributor PR avoidsCHANGELOG.md.Review Conversations
No bot review conversations exist on this new PR at creation time.
Compatibility / Migration
YesNoNoRisks and Mitigations
piwhile the listed agent remainscodex.AI assistance disclosure
This PR is AI-assisted. I reviewed the diff and ran the verification listed above.