Skip to content

feat: offer optional memory embedding setup - #163693

Merged
steipete merged 10 commits into
openclaw:mainfrom
PollyBot13:feat/optional-memory-embedding-setup
Oct 12, 2026
Merged

steipete merged 10 commits into
openclaw:mainfrom
PollyBot13:feat/optional-memory-embedding-setup

Conversation

@PollyBot13

@PollyBot13 PollyBot13 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Related: #16670

What Problem This Solves

Users cannot choose and verify memory embeddings during onboarding or through a dedicated configure section.

User Impact

Local guided/classic onboarding and openclaw configure --section memory offer an optional provider/model step. Cloud providers and running local Ollama/LM Studio servers use the existing embedding adapters; configuration is saved only after a synthetic readiness check and explicit confirmation. Ollama supports installed models such as bge-m3 and nomic-embed-text; LM Studio uses an installed embedding model.

Skipping, failed checks, incompatible retained settings, and declining save preserve memory configuration. A memory-only configure run also leaves the complete config file byte-identical in those cases. Existing per-agent overrides, custom endpoints, and SecretRefs are retained; selecting a different provider drops the old endpoint, headers, and key. Provider/model changes can pause vector search until an explicit openclaw memory index --force. This flow neither opens/rebuilds the index nor downloads models. Managed llama.cpp remains a follow-up through its existing installer/service setup owner.

Why This Change Was Made

One optional flow serves all three entry points. Enabled plugin metadata owns provider availability, the memory configuration owner validates shared defaults and every existing agent's effective settings, provider adapters own the embedding request, and callers own config persistence. The default/legacy provider normalization is shared with runtime so selecting an already-effective OpenAI provider preserves its custom destination. Local HTTP providers can load an already-downloaded model within the bounded readiness budget.

No dependency, public config key, schema, retention, database, or Doctor migration is added. Existing configurations keep their format and indexes are untouched during setup. Maintainer approval covers optional placement, explicit shared-default changes, and the manual-reindex tradeoff. Original implementation by @PollyBot13; contributor commits are preserved, with upstream main merged rather than rebased.

Evidence

  • Base d0df645f66013c79290904ac9c4e69f9749b94fd: real CLI rejects configure --section memory. Original feature CLI reproduced an unwanted metadata rewrite after skipping; repaired CLI leaves the file byte-identical.
  • Real PTY configure matrix: nine successful cases covering Ollama bge-m3, nomic-embed-text, LM Studio text-embedding-nomic-embed-text-v1.5, and a loopback OpenAI-compatible provider stub. Skip/decline/failure preserved config bytes. The stub received only /v1/embeddings with input: ["ping"], using its own fixture credentials rather than the old destination's key.
  • Real classic onboarding verified and saved ollama/bge-m3. Real guided onboarding verified ollama/llama3.2:latest (reply in 6.0s), then preserved memory settings when the optional step was skipped. All CLI runs used isolated HOME/state/config; no operator Gateway or service was changed.
  • Real inherited-agent-multimodal rejection: zero provider requests and byte-identical config. Both omitted-provider and legacy auto OpenAI selections preserved their existing endpoint, headers, and key through the real CLI (68.74s and 39.13s respectively).
  • Regression controls failed before their repairs: both configure persistence paths, native alias discovery, selected-alias SecretRef resolution, inherited-agent multimodal validation, and omitted/legacy OpenAI destination preservation. Final shared-flow suite: 25 passing tests, 3.98s file duration; memory-config sibling suite: 23 passing tests, 219.37s mostly compiled-worker preparation/import (combined wrapper wall 288.51s). Earlier caller proof remains valid: 85 tests in 105.62s across configure/gateway/classic/flow; guided and provenance callers also passed in the seven-file run (100 tests, 107.36s). New tests use no real sleeps/timers or process boots.
  • Full build passed; final runtime build, core typecheck, applicable test types, targeted type-aware lint, relevant CI ratchets, config-doc/plugin-inventory checks, and docs link audit were run. No model-facing prompt/tool text changes.
  • Broader local check: the UI component test graph reproduces the same four errors on the clean merged base in 10.88s. The entire UI/type-config trees and dependency inputs are unchanged by this PR. Upstream 319ec991d02a343014c40b1e623897502ab41d5b (fix(ui): restore MCP App test typechecks #169439) fixes those exact Solid fixture errors. No unrelated UI repair is bundled.

Head: 137e7339f6b939a95f9d317b3eedca0289c02e04. Relative to the merged base: production +415/-18 (net +397), tests/support +755/-62, docs +51/-2. The original feature added 414 production lines; repair work reduces that net by 17 lines while adding local-server support and preservation fixes. Most remaining production code is the single 370-line optional flow: credential input/materialization, provider discovery, bounded probe lifecycle, compatibility validation, and save confirmation. No index manager or provider policy is duplicated. Existing classic-wizard credential fixtures moved to test support to satisfy the line cap.

Independent Codex autoreview: scoped-clean, no actionable P0–P2 findings on head 137e7339f6b939a95f9d317b3eedca0289c02e04. Both accepted findings were reproduced and repaired before this clean pass. ClawSweeper Revision 10 reviewed the same head: no actionable findings, sufficient live proof (5/6). Its product-approval hold is covered by the maintainer's explicit October 11 approval of this feature scope; no new product/config/schema decision is requested.

Hosted CI run 38189573172 completed with one failing test leaf: extensions bundle 2. The two failing session-backfill cases concern deleted/replaced physical-source admission; both failures reproduced in the same observed 10-file order on clean exact CI base 656287c940a5287da9efe69aabde2348695e07e1, with the forgotten-source sibling passing. This establishes inherited failure: this PR does not change the session-backfill test, inventory, or session-read authority owner. The complete clean-base replay passed 190 tests and failed exactly these two across ten files (1038.83s on the heavily loaded host; 82.71s for the hosted failing shard). Upstream 69b99d40994d83683acd40c1fd206ac103c22ba1 (#169310) removed the physical-identity check after asynchronous discovery; a deleted source can reopen empty and a copied replacement can be admitted. The lead owns the separate upstream repair and landing decision. The aggregate openclaw/ci-gate is red. All other completed test/check leaves passed, including baseline ratchets (96 CI seconds), changed checks (251 seconds), and changed boundary tests (82 seconds). No CI rerun was used to turn a failure green.

Readiness: READY-WITH-INHERITED at the exact head above; not merged. The lane prohibits label edits, so the lead still owns the requested ci:no-fail-fast label.

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation commands Command implementations size: L labels Oct 2, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR adds optional embedding provider, model, and credential setup to local onboarding and a dedicated memory configure section.

Example: An operator runs openclaw configure --section memory with Ollama running and bge-m3 installed.

  • Before: The CLI rejects memory as an unknown configure section.
  • After: The operator can verify ollama/bge-m3 with synthetic text and explicitly save it, or skip without rewriting configuration.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong shipped-CLI proof and no actionable patch findings; overall scope remains partial against the linked mandatory-onboarding request, although the optional feature is approved and useful.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The inspected maintainer-recorded CLI evidence exercises real Ollama and LM Studio requests, classic save and guided skip flows, config-byte preservation, inherited multimodal rejection, and old-destination credential isolation; the changed production paths are unchanged at the reviewed head.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Partial
User problem: Users must manually configure embedding providers and credentials instead of choosing and checking them during CLI setup.
Reason: Maintainer approval settles the optional direction and manual-reindex tradeoff; the contribution provides useful CLI setup while leaving the linked issue's broader mandatory-step request open.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it delivers a maintainer-approved setup capability still missing from current main, with no actionable findings in the introduced diff.

Priority: P2
Reviewed head: 4ca132f5d41ef5df1e96c81e9405ef3f52d56b1a

Before merge

None.

Findings

None.

Agent review details

How this fits together

CLI onboarding and configure pass existing configuration into a shared setup flow; plugin metadata supplies choices, embedding adapters perform the readiness request, and existing wizard writers persist confirmed changes.

flowchart LR
  A[CLI onboarding or configure] --> B[Optional memory setup]
  C[Enabled provider metadata] --> B
  B --> D[Existing embedding adapter]
  D --> E[Synthetic readiness request]
  E --> F[Explicit save confirmation]
  F --> G[Existing configuration writer]
Loading

Technical review

Best possible solution:

Land the approved optional flow through existing adapters and configuration writers, retaining explicit save consent and the documented reindex instruction.

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

The setup gap is source-verifiable: current main excludes the memory configure section and lacks this shared flow; supplied real CLI evidence also records the baseline rejection.

Is this the best way to solve the issue?

The implementation fits the approved scope by sharing one optional flow, reusing provider and secret owners, and leaving persistence with existing callers.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 716e1f452694.

Provenance checked

  • Memory provider normalization keeps the original intent (4d89e00: The merged provider work made omitted and legacy auto selections resolve to OpenAI instead of priority-based selection.)
  • Configure action ordering and persistence keeps the original intent (a731397: One canonical action table unified configuration actions and ordered persistence before service and health effects; subsequent commit 2272300 strengthened that write boundary.)
  • Setup credential and authored-config preservation keeps the original intent (07636e8: Existing setup writers preserve authored settings; credential fixtures introduced by the earlier setup repair are relocated without changing their assertions.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Capability remains absent on main: Current main's configure section allowlist excludes memory; the introduced diff adds it and connects all three CLI callers to the shared flow. (src/commands/configure.shared.ts:33, 716e1f452694)
  • Verified PR introduction: The pinned merge-base-to-head diff contains the optional flow, caller wiring, preservation repairs, tests, and documentation; merged base movement was excluded from ownership. (src/flows/memory-setup.ts:90, 4ca132f5d41e)
  • Recorded product approval: steipete's discussion comment explicitly confirms the maintainer-approved optional scope and requests re-review: feat: offer optional memory embedding setup #163693 (comment). The maintainer-authored body records acceptance of shared-default changes and explicit manual reindexing.
  • Behavior proof remains applicable: The inspected body records real PTY configure runs with Ollama and LM Studio, classic save and guided skip scenarios, byte-preserving negative cases, and destination credential isolation. The changed production paths are identical between that proven head and the review checkout. (src/flows/memory-setup.ts:340, 4ca132f5d41e)
  • Preservation and credential boundaries: The flow validates defaults and effective agent settings before probing, materializes only selected-provider credentials for the probe, retains SecretRefs for saving, and returns the original configuration on failure or refusal. (src/flows/memory-setup.ts:263, 4ca132f5d41e)
  • Original intent preserved: Historical source attributes default/auto OpenAI normalization to commit 4d89e00 and canonical configure ordering to a731397; the patch preserves both contracts. (src/agents/memory-search.ts:73, 716e1f452694)

Likely related people:

  • Peter Steinberger: Raw commit a731397 adds src/commands/configure.wizard.ts:748 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: a731397ea176; files: src/commands/configure.wizard.ts)
  • Ayaan Zaidi: Raw commit 715859a adds src/agents/memory-search.ts:133 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 715859aacb1b; files: src/agents/memory-search.ts)

PR surface

Source +397, Tests +693, Docs +49. Total +1139 across 18 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 6 415 18 +397
Tests 8 755 62 +693
Docs 4 51 2 +49
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 18 1221 82 +1139

Review metrics

Metric Value Why it matters
Production versus tests Production +415/-18; tests and support +755/-62 Production growth primarily implements one shared optional flow; tests cover config preservation, credential isolation, compatibility rejection, and bounded probe cleanup.
Configuration surface 1 new configure section; 0 new persisted config keys or schemas The memory section exposes existing configuration and provider contracts without introducing another storage format.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: A bounded setup improvement makes existing embedding capabilities easier to configure without making them a first-run requirement.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (13 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-10T10:26:35.247Z sha c9addaf1b612341dd2556511b2703fbc9108bc13 :: blocked before merge. :: [P3] Extract the additions from files rejected by the line-cap gate
  • reviewed 2026-10-10T10:44:25.334Z sha 5f4cba622f5a80fc9f5058889cfe89b01633a4cc :: blocked before merge. :: none
  • reviewed 2026-10-10T11:07:34.481Z sha 5f4cba622f5a80fc9f5058889cfe89b01633a4cc :: blocked before merge. :: none
  • reviewed 2026-10-10T18:21:05.665Z sha 7da8ab9 :: blocked before merge. :: [P2] [P2] Compare the effective provider before dropping saved credentials
  • reviewed 2026-10-12T01:02:34.493Z sha 137e733 :: blocked before merge. :: none
  • reviewed 2026-10-12T01:12:12.272Z sha 137e733 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-12T02:28:25.079Z sha 137e733 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-12T03:35:30.515Z sha 49fee34 :: needs maintainer review before merge. :: none

Reviewed October 12, 2026, 1:23 AM ET / 05:23 UTC (Revision 14).

@PollyBot13

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 2, 2026
@PollyBot13
PollyBot13 marked this pull request as ready for review October 3, 2026 08:03
@PollyBot13
PollyBot13 force-pushed the feat/optional-memory-embedding-setup branch from d9403a1 to c9addaf Compare October 10, 2026 10:18
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 10, 2026
@clawsweeper clawsweeper Bot added the status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. label Oct 10, 2026
Keep skipped, failed, or declined memory configuration byte-preserving. Offer configured native embedding aliases and resolve their own credentials for readiness checks. Clarify Ollama and LM Studio setup, allow existing models time to load, and reuse the shared timeout owner.
@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Oct 12, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 12, 2026
@steipete

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

Maintainer-approved optional embedding setup scope is preserved. Upstream main was merged without rewriting the contributor commits. Current head adds real local Ollama/LM Studio proof, fixes skipped config writes and configured-provider aliases, and preserves inherited multimodal settings and implicit OpenAI endpoints. Independent Codex autoreview is clean; the PR body has the boundary proof and exact inherited UI type failure attribution. Please review head 137e7339f6b939a95f9d317b3eedca0289c02e04.

@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 12, 2026
@steipete steipete self-assigned this Oct 12, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Oct 12, 2026
@steipete
steipete merged commit d6974ac into openclaw:main Oct 12, 2026
128 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
* feat: offer optional memory embedding setup

* fix: preserve incompatible multimodal memory selections during setup

* test: distinguish setup security consent from optional memory

* test: preserve memory setup mock export contracts

* fix: preserve optional embedding setup and support local servers

Keep skipped, failed, or declined memory configuration byte-preserving. Offer configured native embedding aliases and resolve their own credentials for readiness checks. Clarify Ollama and LM Studio setup, allow existing models time to load, and reuse the shared timeout owner.

* fix: validate inherited agent memory settings during setup

* fix: retain implicit OpenAI embedding destinations during setup

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL 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.

2 participants