Skip to content

fix #92582: Bug: doctor falsely warns local memory embeddings are not ready#95393

Merged
vincentkoc merged 2 commits into
openclaw:mainfrom
mikasa0818:feat/issue-92582
Jun 24, 2026
Merged

fix #92582: Bug: doctor falsely warns local memory embeddings are not ready#95393
vincentkoc merged 2 commits into
openclaw:mainfrom
mikasa0818:feat/issue-92582

Conversation

@mikasa0818

@mikasa0818 mikasa0818 commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #92582

Summary

openclaw doctor can warn that local memory embeddings are "not confirmed ready" even when the configured local memory stack is healthy. This PR makes the local-provider doctor renderer honor the gateway's explicit skipped-probe state, matching the existing key-optional provider behavior.

What Problem This Solves

  • Behavior or issue addressed: Doctor rendered a fix-required local embeddings warning when the gateway intentionally skipped the embedding readiness probe (probe: false).
  • Why it matters / User impact: Users with working local GGUF embeddings could see a misleading warning even after openclaw memory status --deep confirmed embeddings, vector store, semantic vectors, and FTS were ready.

Fix classification

  • Fix classification: Minimal root-cause diagnostic fix. It fixes the renderer invariant for one provider branch so intentionally skipped probes do not become warnings.
  • Maintainer-ready confidence: High for the source-level diagnostic path. The changed branch is small, the existing timeout warning remains covered, and the new regression exercises the exact skipped-probe shape returned by the gateway helper.

Root Cause

  • Root cause: probeGatewayMemoryStatus() already returns checked: false and skipped: true when the gateway intentionally skips the embedding readiness probe. The key-optional provider renderer returns early for that state, but the local-provider renderer only returned for checked && ready, so skipped local probes fell through to the "local embeddings are not confirmed ready" warning.
  • Why this is root-cause fix: The source-of-truth diagnostic contract is the structured gatewayMemoryProbe state. Honoring skipped in the local provider branch restores that contract without changing gateway probing or suppressing checked failures.

Changes

  • Return early from the local-provider doctor branch when gatewayMemoryProbe.skipped is true.
  • Add regression coverage for a configured local GGUF model with a skipped gateway embedding probe.
  • Keep the existing timeout/inconclusive-probe warning path unchanged.

Scope boundary

This PR only changes doctor diagnostic rendering in src/commands/doctor-memory-search.ts and its focused regression test. It does not change gateway probe RPC parameters, openclaw memory status --deep, embedding model loading, vector-store readiness, or local provider runtime behavior.

Source-of-truth boundary

The existing gatewayMemoryProbe object is the source of truth: skipped: true means the gateway intentionally did not perform an embedding readiness probe. This PR consumes that existing contract in the local provider branch; it does not add a new config option or redefine gateway memory status payloads.

Real behavior proof

  • Real environment tested: openclaw doctor --non-interactive --no-color from the issue worktree on Windows Git Bash with an isolated OPENCLAW_CONFIG_PATH, OPENCLAW_STATE_DIR, and OPENCLAW_HOME. The temporary config set agents.defaults.memorySearch.provider=local and an explicit agents.defaults.memorySearch.local.modelPath=hf:ggml-org/embeddinggemma-300m-qat-q8_0-GGUF/embeddinggemma-300m-qat-Q8_0.gguf. Gateway auth used an exec SecretRef and the command intentionally omitted --allow-exec, which makes doctor skip gateway health probes instead of running the exec credential.
  • Exact steps or command run after this patch: OPENCLAW_CONFIG_PATH=<tmp>/openclaw.json OPENCLAW_STATE_DIR=<tmp>/state OPENCLAW_HOME=<tmp>/home NO_COLOR=1 NODE_OPTIONS="--require <tmp>/node-version-shim.cjs" pnpm -s openclaw doctor --non-interactive --no-color
  • Evidence after fix: The doctor command exited 0. Its output included the expected skipped-probe diagnostic and did not include either local embedding false-positive string.
Gateway health probes skipped because gateway credentials use an exec
SecretRef. Run `openclaw doctor --allow-exec` to verify Gateway health
with exec SecretRefs.
...
Doctor complete.
exit=0
probe summary:
Gateway health probes skipped: True
Memory search provider is set to "local": False
local embeddings are not confirmed ready: False
  • Observed result after fix: With local memory search configured and the gateway memory probe intentionally skipped, openclaw doctor completed without rendering Memory search provider is set to "local" or local embeddings are not confirmed ready.
  • What was not tested: No live local GGUF model download/inference was performed, and no real gateway health probe was run. This proof specifically covers the reported skipped-probe doctor path, which is the path that produced the false warning.

Review findings addressed

  • RF-001: Added redacted terminal output from a patched openclaw doctor run with local memory search configured, showing the false warning strings were absent.
  • RF-002: Updated this PR body with after-fix configured local-provider doctor output and the exact sanitized command shape.
  • RF-003: The previous source-only proof gap is addressed by the CLI doctor output above. Live GGUF inference and a real gateway health probe remain intentionally untested and are disclosed in the proof boundary.
  • RF-004: Several open PRs target the same linked issue. This PR keeps its diff XS and focused; choosing the canonical overlapping branch is a maintainer decision.
  • RF-005: No additional narrow automated code repair is left on this branch beyond the proof/body update; maintainers still need to choose the canonical overlapping PR.

Verification

  • OPENCLAW_CONFIG_PATH=<tmp>/openclaw.json OPENCLAW_STATE_DIR=<tmp>/state OPENCLAW_HOME=<tmp>/home NO_COLOR=1 NODE_OPTIONS="--require <tmp>/node-version-shim.cjs" pnpm -s openclaw doctor --non-interactive --no-color
    Observed: exited 0; output showed gateway probes skipped and no local embeddings warning.
  • node scripts/run-vitest.mjs src/commands/doctor-memory-search.test.ts src/commands/doctor-gateway-health.test.ts src/flows/doctor-health-contributions.test.ts
    Observed: exited 0.
  • node scripts/run-oxlint.mjs src/commands/doctor-memory-search.ts src/commands/doctor-memory-search.test.ts
    Observed: exited 0.
  • git diff --check HEAD~1 HEAD
    Observed: exited 0.

Regression Test Plan

  • Target test file: src/commands/doctor-memory-search.test.ts
  • Regression scenario: The new test configures provider local with an explicit hf: model path and passes the gateway skipped-probe shape: checked: false, ready: false, skipped: true.
  • Test guardrail rationale: The regression targets the renderer boundary where the bug lives. The neighboring timeout test still uses checked: false, ready: false, skipped: false and expects the warning, preventing the fix from masking real gateway failures.

Additional Check

  • pnpm check:test-types was attempted after the commit. It did not pass in this checkout because of an existing unrelated type error outside this diff:
[WARN] Unsupported engine: wanted: {"node":">=22.19.0"} (current: {"node":"v22.17.0","pnpm":"11.2.2"})
packages/sdk/src/package.e2e.test.ts(127,5): error TS2322: Type 'string | URL' is not assignable to type 'string'.
  Type 'URL' is not assignable to type 'string'.

Patch quality notes

  • Patch quality notes: XS diff: one production branch check and one regression test. It avoids broad doctor behavior changes, does not auto-run deep probes, and does not downgrade transport failures or checked not-ready states.

Merge risk

  • Risk labels considered: merge-risk: session-state signal because doctor memory diagnostics touch memory/session-adjacent health reporting.
  • Risk explanation: The change affects only doctor output for the explicit skipped-probe state. It does not mutate memory/session state, gateway probing, or embedding readiness.
  • Why acceptable: Checked not-ready probes and transport timeouts still warn. The only newly neutral state is the gateway's explicit "probe intentionally skipped" discriminator.

Risk / Scope

Low risk, diagnostic-only. The failure mode of this change is bounded to doctor output for local memory search.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS labels Jun 20, 2026
@clawsweeper

clawsweeper Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 23, 2026, 6:06 PM ET / 22:06 UTC.

Summary
The PR makes the local memory-search doctor renderer treat an intentionally skipped gateway embedding probe as neutral unless a configured local model path is unavailable, and adds focused regression coverage.

PR surface: Source +5, Tests +41. Total +46 across 2 files.

Reproducibility: yes. source inspection gives a high-confidence reproduction path: current main can pass gatewayMemoryProbe { checked: false, ready: false, skipped: true } into the local-provider renderer and still reach the warning. The linked issue also includes terminal output from a configured local-provider setup, but I did not run a live command in this read-only review.

Review metrics: 1 noteworthy metric.

  • Overlapping fix candidates: 3 other open sibling PRs. Multiple active branches target the same canonical doctor-memory false positive, so maintainers should choose one landing path before merge.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-memory-search.test.ts, vector/embedding metadata: src/commands/doctor-memory-search.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #92582
Summary: This PR is a candidate fix for the canonical local memory doctor skipped-probe false-warning issue; several sibling PRs overlap and none has merged yet.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Maintainer should choose the canonical branch among the open sibling PRs before merge.

Risk before merge

  • [P1] Several same-issue PRs are still open, so maintainers should choose one canonical branch before landing to avoid duplicate close churn.
  • [P1] This branch fixes the skipped-probe rendering path only; a broader open sibling changes whether doctor --deep forces a live embedding probe, so the desired scope needs maintainer confirmation.

Maintainer options:

  1. Pick The Canonical Fix (recommended)
    A maintainer should select this proof-sufficient guard-only branch or a sibling as the single landing path before merge.
  2. Land Guard-Only Scope
    Maintainers can merge this focused renderer fix and leave doctor --deep live-probe forwarding to a separate follow-up if still desired.
  3. Use The Broader Probe Scope
    If doctor --deep must force the embedding probe in the same change, pause or close this branch and review the broader sibling instead.

Next step before merge

  • [P2] Needs human maintainer selection among overlapping PRs; no narrow automated repair remains on this branch.

Security
Cleared: The final diff only changes doctor diagnostic control flow and a colocated Vitest test, with no dependency, workflow, secret, permission, package, or supply-chain surface.

Review details

Best possible solution:

Land one canonical doctor-memory fix that treats intentionally skipped local embedding probes as neutral, preserves checked failure and timeout warnings, and either defers or explicitly includes the doctor --deep live-probe behavior.

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

Yes, source inspection gives a high-confidence reproduction path: current main can pass gatewayMemoryProbe { checked: false, ready: false, skipped: true } into the local-provider renderer and still reach the warning. The linked issue also includes terminal output from a configured local-provider setup, but I did not run a live command in this read-only review.

Is this the best way to solve the issue?

Yes for the guard-only false-positive scope: mirroring the skipped-probe handling already used by sibling provider paths is the narrowest maintainable renderer fix. The remaining decision is whether this PR or a broader doctor --deep probe-forwarding sibling should be canonical.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b08d901dd2fc.

Label changes

Label justifications:

  • P2: This is a normal-priority doctor diagnostic bugfix with limited blast radius but real user confusion for healthy local memory setups.
  • merge-risk: 🚨 other: Merging this branch chooses a guard-only scope while overlapping open PRs include a broader doctor --deep probe behavior change.
  • 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 (terminal): The PR body includes redacted after-fix terminal output from a configured local-provider openclaw doctor run showing the skipped-probe diagnostic and absence of the local embeddings warning.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes redacted after-fix terminal output from a configured local-provider openclaw doctor run showing the skipped-probe diagnostic and absence of the local embeddings warning.
Evidence reviewed

PR surface:

Source +5, Tests +41. Total +46 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 5 0 +5
Tests 1 41 0 +41
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 46 0 +46

What I checked:

  • Repository policy read: Root AGENTS.md was read fully; no scoped AGENTS.md exists under src/commands, and the review applied the repository's whole-path PR review and duplicate-search guidance. (AGENTS.md:1, b08d901dd2fc)
  • Current main still has the false-warning path: The current local-provider branch returns only when the gateway probe is checked and ready; it does not treat a skipped probe as neutral before emitting the reported local embeddings warning. (src/commands/doctor-memory-search.ts:470, b08d901dd2fc)
  • Sibling provider invariant: The key-optional provider branch in the same renderer already returns on gatewayMemoryProbe.skipped while preserving checked-not-ready and timeout warnings. (src/commands/doctor-memory-search.ts:535, b08d901dd2fc)
  • Gateway skipped-probe contract: probeGatewayMemoryStatus calls doctor.memory.status with probe: false and maps an unchecked embedding payload to skipped: true, distinguishing intentional skips from transport failures. (src/commands/doctor-gateway-health.ts:147, b08d901dd2fc)
  • Doctor caller path: The doctor health flow can set ctx.gatewayMemoryProbe to a skipped state when exec-backed gateway probes are intentionally skipped, then passes that state into noteMemorySearchHealth. (src/flows/doctor-health-contributions.ts:976, b08d901dd2fc)
  • PR diff scope: The PR adds a local skipped-probe early return with an exception for unavailable configured local model paths, plus tests for both skipped-and-configured and skipped-but-missing-local-model cases. (src/commands/doctor-memory-search.ts:473, f6ab4a6535ea)

Likely related people:

  • osolmaz: Commit 3137110 moved the local llama.cpp runtime to a provider plugin and changed the local doctor memory-search branch and tests implicated by this warning. (role: introduced current local-provider behavior; confidence: high; commits: 31371101678d; files: src/commands/doctor-memory-search.ts, src/commands/doctor-memory-search.test.ts)
  • hclsys: Commits 45082aa and 549624f added the skipped-probe discriminator and sibling-provider neutral skipped handling that this PR mirrors for local. (role: adjacent prior fix author; confidence: high; commits: 45082aaed3d0, 549624ffb204; files: src/commands/doctor-memory-search.ts, src/commands/doctor-gateway-health.ts, src/commands/doctor-memory-search.test.ts)
  • vincentkoc: Current-main blame on the active doctor memory, gateway health, and gateway doctor method lines points to recent broad command work, and the PR is currently assigned to vincentkoc. (role: recent area contributor; confidence: medium; commits: 8e6624cb6cb8, c645ec4555c0, 095a44c8de4d; files: src/commands/doctor-memory-search.ts, src/commands/doctor-gateway-health.ts, src/flows/doctor-health-contributions.ts)
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.

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.

@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: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Jun 20, 2026
@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 Jun 20, 2026
@vincentkoc vincentkoc self-assigned this Jun 23, 2026
@vincentkoc
vincentkoc force-pushed the feat/issue-92582 branch 3 times, most recently from 94cb450 to 3f770d3 Compare June 23, 2026 11:29
@vincentkoc
vincentkoc requested a review from a team as a code owner June 23, 2026 14:40
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: nextcloud-talk Channel integration: nextcloud-talk channel: telegram Channel integration: telegram gateway Gateway runtime extensions: memory-core Extension: memory-core scripts Repository scripts docker Docker and sandbox tooling agents Agent runtime and tooling labels Jun 23, 2026
@github-actions github-actions Bot removed the dependencies-changed PR changes dependency-related files label Jun 23, 2026
@vincentkoc
vincentkoc force-pushed the feat/issue-92582 branch 2 times, most recently from d453bac to f6ab4a6 Compare June 23, 2026 15:49
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: googlechat Channel integration: googlechat channel: imessage Channel integration: imessage channel: line Channel integration: line channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost labels Jun 24, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. 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: XS 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 falsely warns local memory embeddings are not ready

2 participants