fix(doctor): clear stale runtime override pins#84221
Conversation
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. from source inspection: current main skips PR rating Rank-up moves:
What the crustacean ranks mean
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 Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest 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 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:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 79be9401306f. |
|
@clawsweeper re-review Updated the PR with the missing production owner wiring from the P1:
Verification is in the PR body; final autoreview is clean. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Frosted Signal Puff Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
a9e1ecc to
3b3bb1e
Compare
* fix(doctor): clear stale runtime override pins * fix(doctor): register CLI runtime session owners
* fix(doctor): clear stale runtime override pins * fix(doctor): register CLI runtime session owners
* fix(doctor): clear stale runtime override pins * fix(doctor): register CLI runtime session owners
* fix(doctor): clear stale runtime override pins * fix(doctor): register CLI runtime session owners
* fix(doctor): clear stale runtime override pins * fix(doctor): register CLI runtime session owners
* fix(doctor): clear stale runtime override pins * fix(doctor): register CLI runtime session owners
* fix(doctor): clear stale runtime override pins * fix(doctor): register CLI runtime session owners
* fix(doctor): clear stale runtime override pins * fix(doctor): register CLI runtime session owners
* fix(doctor): clear stale runtime override pins * fix(doctor): register CLI runtime session owners
* fix(doctor): clear stale runtime override pins * fix(doctor): register CLI runtime session owners
* fix(doctor): clear stale runtime override pins * fix(doctor): register CLI runtime session owners
Summary
agentRuntimeOverrideentries in doctor session route-state detection.agentHarnessIdpins, including routes where the owner provider remains configured but the configured runtime moved elsewhere.doctor --fixloads the owners through plugin doctor contracts.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.tsnode 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.tsnode node_modules/@typescript/native-preview/bin/tsgo.js --noEmit --pretty false -p tsconfig.jsongit 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 --fixcan now detect and clear stale session-levelagentRuntimeOverridepins such asclaude-cliwhen 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.jsonwith"agentRuntimeOverride":"claude-cli", then ranOPENCLAW_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 routeandCleared 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
/statusflow; the real proof exercises the persisted session store throughdoctor --fix, and focused tests cover scanner preservation cases plus Anthropic/Google doctor contract owner loading.