fix(doctor): clear stale runtime override pins#83149
Conversation
|
Codex review: needs real behavior proof before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. Source inspection and the PR's proposed regression show that a session entry containing only Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Carry the matched pinned-runtime field through the scan result, or otherwise clear Do we have a high-confidence way to reproduce the issue? Yes. Source inspection and the PR's proposed regression show that a session entry containing only Is this the best way to solve the issue? No. Extending the existing doctor cleanup is the right direction, but this implementation should preserve owner boundaries when deciding which persisted runtime field to clear. Full review comments:
Overall correctness: patch is incorrect What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 019dbcc7490e. |
|
Closing stale contributor PR that has been open for over a week without merge progress. I am keeping the branch intact so it can be reopened or reused if maintainers want to continue it. |
Summary
agentRuntimeOverride-only entries.agentRuntimeOverridevalues like stale pinned runtime state and clear them withagentHarnessIdduringdoctor --fixrepair.claude-cli/google-gemini-clipins can be detected beyond the legacy Codex path.Change Type
Scope
Linked Issue/PR
Real behavior proof
Behavior or issue addressed:
doctor --fixpreviously only cleaned legacy Codex stale route pins. A session containing onlyagentRuntimeOverride: "claude-cli"was not even scanned, so stale Claude/other CLI runtime pins could persist after the configured route moved back to PI/OpenAI.Real environment tested: macOS source checkout of
openclaw/openclaw, branchfix/83098-doctor-runtime-pins, Node/pnpm workspace with existing dependencies, rebased ontoupstream/mainataaf85166, commit94789d296944c442faf64e7ccb3b16c6971cbf34.Exact steps or command run after this patch:
Evidence after fix:
Observed result after fix: the new regression proves an entry with only
agentRuntimeOverride: "claude-cli"makesstoreMayContainPluginSessionRouteState(...)return true, scans as a stale Anthropic pinned runtime when the configured route is PI/OpenAI, andapplySessionRouteStateRepair(...)removesagentRuntimeOverridewhile updatingupdatedAt. A negative control keeps the runtime override when the route is still configured for the Anthropic/Claude runtime.What was not tested: a live
openclaw doctor --fixrun against a user's real session-store file; the behavior is covered at the doctor session route-state repair seam with in-memory session entries and plugin owner metadata, without touching local user state.Before evidence: in a temporary upstream-main red worktree, the new regression failed because runtime override-only entries were skipped and stale
agentRuntimeOverridewas not removed by pinned-runtime repair. After this patch the same regression passes in the focused Vitest command above.Root Cause
storeMayContainPluginSessionRouteState(...)did not includeagentRuntimeOverride, so runtime override-only session entries skipped plugin route-state scanning.agentHarnessId, notagentRuntimeOverride.pinned runtimeclearedagentHarnessIdbut leftagentRuntimeOverridebehind.sessionRouteStateOwners, leaving their CLI runtime pins outside the generic cleanup path.Regression Test Plan
src/commands/doctor-session-state-providers.test.tssrc/plugins/doctor-contract-registry.test.tsconfirms plugin doctor contracts still load through the registry.User-visible / Behavior Changes
openclaw doctor --fixcan now clean stale plugin-owned CLI runtime overrides such asclaude-cli/google-gemini-cli, not just legacy CodexagentHarnessIdstate, when the session route no longer allows that owner.Security Impact
Compatibility / Migration
Risks and Mitigations
claude-cliwhen the route is configured for Anthropic/Claude.Review Conversations