Skip to content

[BUG] memory index --force CLI writes incompatible meta providerKey, breaks runtime memory_search #91902

Closed as not planned

Description

@charles717-art

Version: 2026.6.5

Environment: memorySearch provider = openai-compatible (DashScope), model = text-embedding-v4

Bug: Running openclaw memory index --force disables memory_search with "index built with a different provider" error.

Root cause: CLI creates MemoryIndexManager with purpose="cli", no providerResult. computeProviderKey() returns SHA256({provider:"none", model:"fts-only"}). The runtime manager has a full embedding provider with cacheKeyData containing {provider, baseUrl, model, headers} — hashes never match, search gets permanently disabled until meta is manually rewritten.

scopeHash issue: normalizeMemoryMultimodalSettings sets maxFileBytes=10485760 when not configured, not 0 — affects scopeHash computation.

Suggested fix: CLI manager should load the runtime provider config for computing providerKey, or the runtime should auto-fix mismatched meta instead of disabling search.


Reported from user feedback via workspace agent

Activity

  1. clawsweeper commented on Jun 10, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 21, 2026, 12:31 PM ET / 16:31 UTC.

    Summary
    Keep open. Current main still has the memory index identity gates that can disable runtime memory_search on providerKey, model, or scopeHash drift, and the related open PRs are partial fixes rather than a merged canonical solution.

    Reproducibility: no. high-confidence live current-main reproduction was run. Source inspection confirms the active fail-closed identity path, and the issue/comments provide concrete 2026.6.5/2026.6.6 providerKey, provider-model, and scopeHash reproductions.

    Root-cause cluster
    Relationship: canonical
    Canonical: #91902
    Summary: This issue is the canonical providerKey/CLI-runtime identity tracker; sibling issues and PRs cover scopeHash, provider.model, registry lookup, and persistent manager-state slices.

    Members:

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

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.
    • Include redacted logs or terminal output.

    Next step
    Manual review is needed because the issue already has no-new-fix-pr and product-decision signals, and the remaining boundary spans compatibility-sensitive provider identity, scopeHash, and runtime fail-closed policy.

    Review details

    Best possible solution:

    Keep this issue open as the canonical providerKey/CLI-runtime memory identity tracker until maintainers land a coordinated fix and prove CLI force-reindex plus gateway memory_search agree for non-default providers.

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

    No high-confidence live current-main reproduction was run. Source inspection confirms the active fail-closed identity path, and the issue/comments provide concrete 2026.6.5/2026.6.6 providerKey, provider-model, and scopeHash reproductions.

    Is this the best way to solve the issue?

    No close-ready solution exists yet. The best fix needs a maintainer-approved memory identity policy that makes CLI reindex, runtime provider resolution, providerKey, and scopeHash agree without destructive or silent metadata invalidation.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • No live DashScope, Voyage, OAuth-profile, or current-main gateway reproduction was run in this read-only review; confidence comes from source inspection plus recent 2026.6.x reports.
    • The remaining fix boundary spans provider identity, provider.model normalization, generic provider registry resolution, scopeHash policy, and fail-closed mismatch behavior, so a one-line auto-fix could miss a sibling path.
    • Open partial PRs may fix useful slices, but closing this issue before one merged canonical path has live CLI-reindex plus runtime memory_search proof would lose the providerKey tracker.

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

    Label changes

    Label changes:

    • remove clawsweeper:fix-shape-clear: Current issue advisory state no longer selects this label.

    Label justifications:

    • P1: The issue reports a user-facing memory_search failure that can disable configured semantic memory recall after the documented force-reindex workflow.
    • impact:session-state: The failure leaves durable memory index identity and live runtime memory recall state out of sync.
    • impact:auth-provider: The report centers on embedding provider identity, providerKey hashing, model choice, non-default providers, and auth/profile resolution.
    Evidence reviewed

    What I checked:

    • Root and scoped repository policy read: Root AGENTS.md plus extensions/AGENTS.md and src/agents/AGENTS.md were read; their provider-routing, config, persisted state, and memory plugin boundary guidance applies to this review. (AGENTS.md:1, c2ee9b0be8ae)
    • Runtime config resolver still lacks generic provider fallback: Current main resolves memorySearch providers only through the memory-specific registry or a configured api owner; it does not include the generic embedding provider fallback proposed by the open related PR. (src/agents/memory-search.ts:178, c2ee9b0be8ae)
    • Provider creation still returns provider.model unchanged: createWithAdapter resolves the model for adapter.create(), then returns result.provider unchanged, so the open provider.model backfill PR still covers a real current-main gap. (extensions/memory-core/src/memory/embeddings.ts:225, c2ee9b0be8ae)
    • ProviderKey mismatch still fails identity validation: resolveMemoryIndexIdentityState still reports 'index provider settings changed' when persisted meta.providerKey does not match the current provider identity. (extensions/memory-core/src/memory/manager-reindex-state.ts:180, c2ee9b0be8ae)
    • ScopeHash mismatch still fails identity validation: The same identity state code still treats a stored scopeHash mismatch as 'index scope changed', matching the scopeHash subclaim and the related open scope issue. (extensions/memory-core/src/memory/manager-reindex-state.ts:200, c2ee9b0be8ae)
    • Search still returns no results when identity is invalid: MemoryIndexManager.search refreshes index identity and returns an empty result set unless the identity state is valid, so providerKey or scope drift can still disable runtime recall. (extensions/memory-core/src/memory/manager.ts:664, c2ee9b0be8ae)

    Likely related people:

    • xydt-tanshanshan: Authored the closed providerKey auto-fix attempt for this issue and the open provider.model backfill PR that overlaps the remaining identity failure modes. (role: recent related fix author; confidence: high; commits: 1104a9d70304, 494af2d7d807, d39c790452d8; files: extensions/memory-core/src/memory/manager.ts, extensions/memory-core/src/memory/manager-reindex-state.ts, extensions/memory-core/src/memory/embeddings.ts)
    • SunnyShu0925: Authored the open memory-search config resolver PR that targets the generic embedding provider registry gap on the agent-side resolver. (role: adjacent candidate fix author; confidence: medium; commits: 24ff10d00b4f, 9b959e11e67c; files: src/agents/memory-search.ts, src/agents/memory-search.test.ts)
    • steipete: Historical commits moved the memory engine and memory embeddings behind plugin/provider adapter boundaries that own createWithAdapter and provider identity. (role: provider-boundary contributor; confidence: medium; commits: dbf78de7c680, 77e6e4cf87f7, eebce9e9c7cb; files: extensions/memory-core/src/memory/embeddings.ts, packages/memory-host-sdk/src/host/multimodal.ts)
    • gumadeiras: The scopeHash subclaim involves multimodal memory normalization, and history shows the multimodal memory feature was introduced in this area. (role: multimodal memory feature contributor; confidence: medium; commits: d79ca5296054; files: packages/memory-host-sdk/src/host/multimodal.ts, src/agents/memory-search.ts)
    • Vincent Koc: Current checkout blame for the central memory-search resolver and identity/search lines points to the current-main snapshot carried by this author; the checkout history is partly grafted, so this is a routing hint rather than precise introduction proof. (role: recent current-main area contributor; confidence: low; commits: 89a73d08c805, c2ee9b0be8ae; files: src/agents/memory-search.ts, extensions/memory-core/src/memory/manager.ts, extensions/memory-core/src/memory/manager-reindex-state.ts)
    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.
  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.
    impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    on Jun 10, 2026
  3. 1818TusculumSt commented on Jun 15, 2026

    @1818TusculumSt

    Additional reproduction data (June 15)

    Confirmed identical behavior on OpenClaw 2026.6.6. Key details not yet captured in the issue:

    1. Affects any non-default provider. Reproduced with both openai (default) and voyage (voyage-4). The tool rejects requests with the same "index was built for model X, expected Y" pattern regardless of which provider is configured.

    2. Plugin respects config, tool ignores it. agents.defaults.memorySearch.provider: "voyage" is picked up correctly by the plugin/CLI (openclaw memory status --deep shows voyage (requested: voyage)), but the memory_search tool still checks against openai/text-embedding-3-small.

    3. Agent auth-state interference. The agent SQLite (openclaw-agent.sqlite) stores a lastGood auth mapping "openai" → "openai:jonathan.cajigas@gmail.com" (OAuth profile). The tool may be resolving the provider key through this auth store rather than the live memorySearch config, contributing to the hash mismatch.

    4. scopeHash discrepancy confirmed. The normalizeMemoryMultimodalSettings scopeHash issue described in the original report also affects clean builds — using maxFileBytes=10485760 vs 0 when multimodal is not configured.

    Workaround for users who need memory_search: None found yet. Impact is limited since mem0 CLI and smart-mem0 skill bypass the tool entirely.

  4. added
    issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.
    clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    and removed
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.
    issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    on Jun 19, 2026
  5. openclaw-barnacle commented on Jul 6, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  6. openclaw-barnacle commented on Jul 14, 2026

    @openclaw-barnacle

    Closing due to inactivity.
    If this is still an issue, please retry on the latest OpenClaw release and share updated details.
    If you are absolutely sure it still happens on the latest release, open a new issue with fresh steps to reproduce.

  7. locked as resolved and limited conversation to collaborators on Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions