Skip to content

fix(doctor): clear stale runtime override pins#84221

Merged
giodl73-repo merged 4 commits into
mainfrom
fix-doctor-stale-runtime-pins-83098
May 21, 2026
Merged

fix(doctor): clear stale runtime override pins#84221
giodl73-repo merged 4 commits into
mainfrom
fix-doctor-stale-runtime-pins-83098

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented May 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Include legacy agentRuntimeOverride entries in doctor session route-state detection.
  • Treat stale owner-owned runtime overrides like stale agentHarnessId pins, including routes where the owner provider remains configured but the configured runtime moved elsewhere.
  • Track the exact pinned runtime fields matched during scan so repair clears only stale owner-owned pins and preserves unrelated runtime overrides.
  • Register production doctor session-route owners for Anthropic/Claude CLI and Google/Gemini CLI runtimes so doctor --fix loads the owners through plugin doctor contracts.
  • Add regression coverage for stale agentRuntimeOverride-only sessions, provider-still-configured runtime changes, mixed owner/non-owner runtime pins, and doctor contract owner loading.

Fixes #83098.

Verification

  • pnpm exec oxfmt --check --threads=1 extensions/anthropic/doctor-contract-api.ts extensions/google/doctor-contract-api.ts src/plugins/doctor-contract-registry.test.ts src/commands/doctor-session-state-providers.ts src/commands/doctor-session-state-providers.test.ts
  • node scripts/run-vitest.mjs src/commands/doctor-session-state-providers.test.ts src/plugins/doctor-contract-registry.test.ts src/commands/doctor/shared/codex-route-warnings.test.ts
  • node node_modules/@typescript/native-preview/bin/tsgo.js --noEmit --pretty false -p tsconfig.json
  • git diff --check -- extensions/anthropic/doctor-contract-api.ts extensions/google/doctor-contract-api.ts src/plugins/doctor-contract-registry.test.ts src/commands/doctor-session-state-providers.ts src/commands/doctor-session-state-providers.test.ts
  • .agents/skills/autoreview/scripts/autoreview --parallel-tests "node scripts/run-vitest.mjs src/commands/doctor-session-state-providers.test.ts src/plugins/doctor-contract-registry.test.ts src/commands/doctor/shared/codex-route-warnings.test.ts"

Real behavior proof

Behavior addressed: doctor --fix can now detect and clear stale session-level agentRuntimeOverride pins such as claude-cli when the configured route no longer uses that runtime, with the owner discovered from production plugin doctor contracts.
Real environment tested: WSL-local OpenClaw source checkout on PR head cb7845511c.
Exact steps or command run after this patch: Created a temp state dir containing agents/main/sessions/sessions.json with "agentRuntimeOverride":"claude-cli", then ran OPENCLAW_HOME="$tmp/home" OPENCLAW_STATE_DIR="$tmp/state" OPENCLAW_CONFIG_PATH="$tmp/state/openclaw.json" node --import tsx src/entry.ts doctor --fix --non-interactive --yes --no-workspace-suggestions.
Evidence after fix: The real doctor run reported Found stale Anthropic session routing state in 1 session outside the current configured model/runtime route and Cleared stale Anthropic session routing state for 1 session.
Observed result after fix: Before the command, the temp session entry was {"sessionId":"sess-stale-claude-cli","updatedAt":1,"agentRuntimeOverride":"claude-cli"}. After the command, it was {"sessionId":"sess-stale-claude-cli","updatedAt":1779214321852}.
What was not tested: A live gateway or message-channel /status flow; the real proof exercises the persisted session store through doctor --fix, and focused tests cover scanner preservation cases plus Anthropic/Google doctor contract owner loading.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: M maintainer Maintainer-authored PR labels May 19, 2026
@clawsweeper

clawsweeper Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Workflow note: Future ClawSweeper reviews update this same comment in place.

How this review workflow works
  • 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.

Summary
The PR updates doctor --fix to detect and repair stale agentRuntimeOverride runtime pins via owner metadata, adds Anthropic/Google doctor route-state owners, and adds regression coverage.

Reproducibility: yes. from source inspection: current main skips agentRuntimeOverride in the plugin route-state scan gate and pinned-runtime repair only deletes agentHarnessId. I did not run a mutating current-main doctor --fix command in this read-only review.

PR rating
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Summary: Good normal PR readiness: the implementation is focused, proof is sufficient, and the remaining blockers are maintainer ownership and canonical-branch choice rather than contributor fixes.

Rank-up moves:

  • none
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

Real behavior proof
Sufficient (live_output): The PR body includes copied live output from a real doctor --fix run against a temporary persisted session store, including before/after JSON showing the stale runtime override removed.

Risk before merge

  • doctor --fix will now delete persisted session-level runtime pins when owner metadata classifies them as stale; maintainers should explicitly accept the Anthropic and Google owner scope before merge.
  • The overlapping draft at fix(doctor): clear stale runtime override pins #83149 targets the same linked bug, so merging both would create duplicate implementations or review churn.

Maintainer options:

  1. Use This PR As Canonical (recommended)
    If maintainers accept the Anthropic and Google owner metadata, land this branch and redirect the overlapping draft so one implementation owns the cleanup.
  2. Fold The Proof Into The Draft
    If maintainers prefer fix(doctor): clear stale runtime override pins #83149 as canonical, carry this branch's exact-field repair and real doctor --fix proof there instead.
  3. Ask For Broader Upgrade Proof
    If the owner scope is still uncertain, require packaged or upgrade-style proof covering both Anthropic and Google stale runtime pins before merge.

Next step before merge
A maintainer needs to accept the session-state cleanup semantics and choose this branch or the overlapping draft as canonical; there is no narrow automated repair to make on this PR.

Security
Cleared: The diff adds no dependencies, workflows, network access, lifecycle scripts, or credential-handling expansion; the sensitive surface is limited to owner-scoped local session cleanup.

Review details

Best possible solution:

Land one canonical implementation that clears only owner-matched stale runtime pins through doctor owner contracts, then close the linked bug after merge.

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

Yes from source inspection: current main skips agentRuntimeOverride in the plugin route-state scan gate and pinned-runtime repair only deletes agentHarnessId. I did not run a mutating current-main doctor --fix command in this read-only review.

Is this the best way to solve the issue?

Yes, with maintainer acceptance of the owner metadata: the PR extends the existing doctor owner-contract path and tracks exact matched fields instead of adding startup migration or broad deletion logic. The remaining decision is which overlapping branch should be canonical.

Label justifications:

  • P2: This is a normal-priority doctor bug fix for stale persisted session routing state with limited blast radius.
  • merge-risk: 🚨 session-state: The PR changes doctor --fix behavior that deletes persisted session-level runtime routing fields when classified as stale.
  • rating: 🐚 platinum hermit: Current PR rating is 🐚 platinum hermit because proof is 🐚 platinum hermit, patch quality is 🐚 platinum hermit, and Good normal PR readiness: the implementation is focused, proof is sufficient, and the remaining blockers are maintainer ownership and canonical-branch choice rather than contributor fixes.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes copied live output from a real doctor --fix run against a temporary persisted session store, including before/after JSON showing the stale runtime override removed.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes copied live output from a real doctor --fix run against a temporary persisted session store, including before/after JSON showing the stale runtime override removed.

What I checked:

Likely related people:

  • Moeed Ahmed: git blame in this shallow/grafted checkout attributes the current doctor session route-state provider and Codex doctor contract lines to commit 9c00268914; deeper ownership history is not available locally. (role: current route-state implementation contributor; confidence: low; commits: 9c00268914b9; files: src/commands/doctor-session-state-providers.ts, extensions/codex/doctor-contract-api.ts, src/plugins/doctor-contract-registry.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 79be9401306f.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels May 19, 2026
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated the PR with the missing production owner wiring from the P1:

  • Added Anthropic/Claude CLI sessionRouteStateOwners in the Anthropic doctor contract.
  • Added Google/Gemini CLI sessionRouteStateOwners in a new Google doctor contract, including google-antigravity as a Google-owned provider alias.
  • Added registry coverage for loading multiple CLI route-state owners from doctor contract modules.
  • Added real doctor --fix proof in the PR body showing a stale agentRuntimeOverride: "claude-cli" removed from a persisted temp session store.

Verification is in the PR body; final autoreview is clean.

@clawsweeper

clawsweeper Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 19, 2026
@clawsweeper

clawsweeper Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 🥚 common Frosted Signal Puff

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🥚 common.
Trait: purrs at green checks.
Image traits: location proof lagoon; accessory tiny test log scroll; palette seafoam, black, and opal; mood celebratory; pose holding its accessory up for inspection; shell frosted glass shell; lighting golden review-room light; background soft code-shaped tiles.
Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Frosted Signal Puff in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@giodl73-repo giodl73-repo force-pushed the fix-doctor-stale-runtime-pins-83098 branch from a9e1ecc to 3b3bb1e Compare May 20, 2026 20:58
@giodl73-repo giodl73-repo merged commit 8284c03 into main May 21, 2026
99 checks passed
@giodl73-repo giodl73-repo deleted the fix-doctor-stale-runtime-pins-83098 branch May 21, 2026 06:00
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
* fix(doctor): clear stale runtime override pins

* fix(doctor): register CLI runtime session owners
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
* fix(doctor): clear stale runtime override pins

* fix(doctor): register CLI runtime session owners
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
* fix(doctor): clear stale runtime override pins

* fix(doctor): register CLI runtime session owners
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* fix(doctor): clear stale runtime override pins

* fix(doctor): register CLI runtime session owners
galiniliev pushed a commit to galiniliev/openclaw that referenced this pull request May 25, 2026
* fix(doctor): clear stale runtime override pins

* fix(doctor): register CLI runtime session owners
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
* fix(doctor): clear stale runtime override pins

* fix(doctor): register CLI runtime session owners
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
* fix(doctor): clear stale runtime override pins

* fix(doctor): register CLI runtime session owners
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
* fix(doctor): clear stale runtime override pins

* fix(doctor): register CLI runtime session owners
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
* fix(doctor): clear stale runtime override pins

* fix(doctor): register CLI runtime session owners
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
* fix(doctor): clear stale runtime override pins

* fix(doctor): register CLI runtime session owners
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
* fix(doctor): clear stale runtime override pins

* fix(doctor): register CLI runtime session owners
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations extensions: anthropic extensions: google maintainer Maintainer-authored PR merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

doctor --fix: cleans only codex-route legacy agentRuntimeOverride pins; stale claude-cli/other harness pins persist forever

2 participants