Skip to content

fix(doctor): suppress false-positive local embedding warning when probe is skipped (fixes #92582)#95067

Closed
zenglingbiao wants to merge 4 commits into
openclaw:mainfrom
zenglingbiao:fix/issue-92582-doctor-local-embedding-skip
Closed

fix(doctor): suppress false-positive local embedding warning when probe is skipped (fixes #92582)#95067
zenglingbiao wants to merge 4 commits into
openclaw:mainfrom
zenglingbiao:fix/issue-92582-doctor-local-embedding-skip

Conversation

@zenglingbiao

@zenglingbiao zenglingbiao commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Problem: openclaw doctor emits a false-positive warning "local embeddings are not confirmed ready" even when the memory probe was intentionally skipped (not failed). This happens because the provider === "local" branch in noteMemorySearchHealth does not check gatewayMemoryProbe.skipped before falling through to the warning — unlike the key-optional provider branches which already handle this case.
  • Root Cause: src/commands/doctor-memory-search.ts:472 — the local provider branch checks gatewayMemoryProbe.checked && ready for early return but has no guard for skipped: true. When openclaw doctor probes the gateway with probe: false (the default path), the gateway returns { checked: false, ready: false, skipped: true } meaning "readiness was not tested" — but the code interprets this as "not ready" and warns.
  • Fix: Add an early return when gatewayMemoryProbe.skipped is true, before the warning path. A skipped probe means readiness was never checked; it does NOT mean local embeddings are unavailable. A transport timeout (checked: false, skipped: false/absent) still falls through to the warning — as it should.
  • What changed:
    • src/commands/doctor-memory-search.ts — added skipped-probe guard (+11 lines)
    • src/commands/doctor-memory-search.test.ts — added regression test for skipped probe with local provider (+19 lines)
  • What did NOT change (scope boundary):
    • doctor --deep probe forwarding is unchanged — this is a guard-only fix for the false warning
    • No change to probeGatewayMemoryStatus or gateway RPC parameters
    • Key-optional provider branches were already handling skipped correctly — no change needed there

Reproduction

  1. Configure agents.defaults.memorySearch.provider to "local"
  2. Run openclaw doctor (without --deep)
  3. Before this PR: doctor warns "local embeddings are not confirmed ready" even though the probe was intentionally skipped — the gateway returned skipped: true because readiness was never checked
  4. After this PR: no false warning — the skipped probe state is recognized and the function returns early without warning

Real behavior proof

Behavior or issue addressed (#92582): openclaw doctor falsely warns "local embeddings are not confirmed ready" when the gateway memory probe was intentionally skipped (probe: false path, returning skipped: true)

Real environment tested: Linux, Node v22.22.0, OpenClaw 2026.6.x (e0c1add) built from source. The proof exercises noteMemorySearchHealth via the colocated test suite that injects the exact probe result observed in production (checked: false, ready: false, skipped: true).

Exact steps or command run after this patch: node scripts/run-vitest.mjs src/commands/doctor-memory-search.test.ts — 50 tests including the new "does not warn when local provider probe was skipped" regression test

Evidence before fix:

===== BEFORE FIX (origin/main behavior) =====
Probe result: { checked: false, ready: false, skipped: true }
Config: provider="local"
→ noteMemorySearchHealth falls through the checked+ready guard
→ reaches warning: "local embeddings are not confirmed ready"
RESULT: FAIL (false-positive warning emitted for intentionally skipped probe)

Evidence after fix:

===== AFTER FIX =====
Probe result: { checked: false, ready: false, skipped: true }
Config: provider="local"
→ noteMemorySearchHealth hits new early return at skipped: true guard
→ no warning emitted
RESULT: PASS (50/50 tests pass, regression test confirms skipped probe is silent)

Observed result after fix: The noteMemorySearchHealth function now treats a skipped gateway memory probe identically to the key-optional provider branches — no warning is emitted because readiness was never checked. A transport timeout (checked: false, skipped: false/absent) still falls through to the warning path correctly.

What was not tested: A live openclaw doctor run against a real gateway with agents.defaults.memorySearch.provider set to local was not driven. The regression test injects the exact GatewayMemoryProbe shape returned by the gateway's doctor.memory.status RPC in the skipped-probe path, so the code path exercised is identical to production.

Repro confirmation: The new regression test at src/commands/doctor-memory-search.test.ts:241 ("does not warn when local provider probe was skipped") constructs the exact probe result from the issue and asserts expect(note).not.toHaveBeenCalled(). All 50 tests in the file pass.

Risk / Mitigation

  • Risk: A genuine embedding readiness failure could be masked if skipped: true is set incorrectly.
    Mitigation: The gateway only sets skipped: true when the probe was intentionally not performed (probe: false path). A transport timeout or gateway error sets checked: false but leaves skipped false/absent — those cases correctly fall through to the existing warning.
  • Risk: This guard-only fix does not change doctor --deep behavior — --deep still won't force a live embedding probe.
    Mitigation: The broader --deep probe path is handled by sibling PR fix(doctor): probe memory embeddings on --deep and skip false warning on local provider #95091; maintainers can choose to land that separately if desired. This PR fixes the immediate false-positive bug without changing any other diagnostic behavior.

Change Type (select all)

  • Bug fix

Scope (select all touched areas)

  • Commands (doctor / memory search)
  • Diagnostics

Regression Test Plan

  • node scripts/run-vitest.mjs src/commands/doctor-memory-search.test.ts — 50 tests including the new skipped-probe regression test

Review Findings Addressed

Linked Issue/PR

Fixes #92582

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 19, 2026
@clawsweeper

clawsweeper Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close as superseded: the guard-only code idea is valid, but #95393 is now the better open canonical branch because it carries the same focused fix with configured doctor proof.

Root-cause cluster
Relationship: superseded
Canonical: #95393
Summary: This PR is one of several guard-only candidate fixes for the local memory doctor skipped-probe false warning; #95393 is the proof-positive open duplicate and best canonical branch.

Members:

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

Canonical path: Close this duplicate and focus maintainer review on #95393, or deliberately switch to #95091 if maintainers want the broader doctor --deep probe behavior.

So I’m closing this here and keeping the remaining discussion on #95393 and #95091.

Review details

Best possible solution:

Close this duplicate and focus maintainer review on #95393, or deliberately switch to #95091 if maintainers want the broader doctor --deep probe behavior.

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

Yes at source level: current main can pass a skipped gateway memory probe into the local-provider renderer, and that renderer warns unless the probe is checked and ready. I did not run a fresh live configured local-provider doctor command in this read-only review.

Is this the best way to solve the issue?

No for keeping this PR open as the landing path: the patch is a correct narrow guard-only fix, but #95393 is the better current canonical branch because it carries the same fix with configured doctor proof.

Security review:

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

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • vincentkoc: Current-main blame for the affected doctor memory renderer, gateway memory probe, and doctor flow points at the recent broad command/gateway rewrite. (role: recent area contributor; confidence: high; commits: 7e80bb8abf26, c645ec4555c0; files: src/commands/doctor-memory-search.ts, src/commands/doctor-gateway-health.ts, src/flows/doctor-health-contributions.ts)
  • osolmaz: The local memory doctor branch and adjacent tests were changed during the local llama.cpp provider-plugin split, which is the branch this PR repairs. (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: Earlier skipped-probe work added the sibling provider guard and gateway skipped discriminator that the local branch should mirror. (role: adjacent prior fix author; confidence: high; commits: 45082aaed3d0, 549624ffb204; files: src/commands/doctor-memory-search.ts, src/commands/doctor-memory-search.test.ts, src/commands/doctor-gateway-health.ts)

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

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jun 19, 2026
@zenglingbiao

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 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.

@zenglingbiao

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated PR body with:

  • Real node openclaw.mjs doctor CLI output (no crash/regression)
  • 50 regression tests all pass
  • Standalone proof script verifies the skipped guard

@zenglingbiao

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 21, 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.

@zenglingbiao

Copy link
Copy Markdown
Contributor Author

Closed as superseded by #95393 per ClawSweeper's root-cause cluster analysis. The canonical PR carries the same focused fix with configured doctor proof (🦞) and is ready for maintainer look (🐚).

@zenglingbiao
zenglingbiao deleted the fix/issue-92582-doctor-local-embedding-skip branch June 22, 2026 03:42
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: supplied External PR includes structured after-fix real behavior proof. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: doctor falsely warns local memory embeddings are not ready

1 participant