Skip to content

refactor(memory): remove normalization of fixed search defaults - #130655

Merged
steipete merged 1 commit into
mainfrom
codex/cleanup20k-memory-fixed-defaults-20260826
Aug 27, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/cleanup20k-memory-fixed-defaults-20260826

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Maintainer-requested cleanup: memory-search configuration still carried private normalization paths for retired tuning options, even though those paths receive only fixed constants or undefined. That made the resolver look configurable where it is not and rebuilt the same settings twice.

Why This Change Was Made

Return the existing per-call chunking, sync, hybrid-ranking, and cache objects directly, and use the existing named remote-batch timing defaults. Remove the two unreachable batch-normalization helpers and the unused private sync arguments. The remaining configurable minimum score is still clamped.

Public configuration and SDK types, provider selection, credential handling, default values, source ordering, and storage behavior are unchanged. Nested defaults remain freshly allocated for every call, including the separate sync-only resolver. Explicit undefined fields remain present.

User Impact

No user-visible behavior change or new configuration option. Production LOC: +10/-84 (net -74). Tests: +16/-15; the redundant timeout-only assertion is replaced with mutation-isolation coverage, while the existing full sync-default assertion is strengthened to strict equality.

AI-assisted with Codex.

Evidence

  • Baseline resolver suite: 46 tests passed before editing. Final focused run: 48 tests passed across the resolver, cron config composition, and real SQLite memory-tool suites. The latter uses the real search manager with a deterministic embedding-provider fixture; it is not authenticated provider proof.
  • A read-only differential probe compared the original resolver with the exact candidate under Node 24: 1,904 configuration vectors, 9,009 top-level and 7,488 nested object-freshness checks passed, with identical outputs/errors and ordered calls to controlled dependency boundaries. It uses the actual numeric helpers; public resolved type declarations are byte-identical. This supplements the real resolver/manager tests, not a substitute for them.
  • Targeted typed lint and formatting passed. Both canonical static Madge and runtime import-cycle checks report zero cycles. All three Knip unused-export scans passed.
  • Full local changed gate passed the initial 17 static/format guards but stopped at unrelated core type errors from stale shared dependencies: installed/pinned versions include markdown-it 14.3.0/15.0.0, Google GenAI 2.13.0/2.17.1, and pi-tui 0.82.1/0.84.2. No dependency override, install reconciliation, or source workaround was applied. Exact-head hosted CI is required before landing.
  • Commands: node scripts/run-vitest.mjs src/agents/memory-search.test.ts src/cron/isolated-agent/run.memory-search-config-preserved.test.ts extensions/memory-core/src/tools.real-manager.test.ts; node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/agents/memory-search.ts src/agents/memory-search.test.ts; canonical check-changed, static Madge, and runtime import-cycle scripts.

Independent full-source precommit Codex review passed with no P0-P3 findings. The separate published-head review and exact-head CI remain required before landing.

@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Aug 27, 2026
@steipete
steipete marked this pull request as ready for review August 27, 2026 03:35
@steipete steipete self-assigned this Aug 27, 2026
@steipete

steipete commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Both authenticated Codex review passes completed with no P0–P3 findings, including the separate published-head review of cf09447ab10d08d86c580060ed40a4d70b02eab9.

Ordinary exact-head CI passed without retries. I inspected the actual Linux job logs: the resolver's 46 cases passed with pinned Vitest 4.1.11; production core/UI/plugin type checks, typed lint, and formatting passed. All 65 plugin-config shards and the aggregate CI gate passed. This closes the stale-local-dependency limitation recorded above; the earlier local full-gate failure remains a historical failure, not a claimed local success.

The unchanged supplemental proof includes 48 focused resolver/cron/real SQLite manager tests and a 1,904-vector differential using actual numeric helpers and controlled dependency boundaries. It is not authenticated provider evidence. Resolved signatures, property order, explicit undefined fields, nested object freshness, source ordering, provider/secret behavior and storage semantics remain unchanged. Production net −74 lines; tests net +1.

The completed ClawSweeper review found no patch or security defects and requests only normal maintainer review, which is complete. No Rank-up moves were requested. Its generic stored-data-model flag is not a migration change: this two-file diff changes no schema, indexes, retention, database paths, or storage semantics. The resolved values are equivalent and the existing real SQLite manager proof passes, so no migration is needed.

Native preparation passed with the mandatory hosted-Testbox gate at the unchanged reviewed head, without a push or rebase. Separate pre-existing type/documentation drift was recorded for follow-up: the batch-enabled default comment and the unused store.cache type block; neither is changed by this frozen patch.

@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 11:41 PM ET / August 27, 2026, 03:41 UTC.

ClawSweeper review

What this changes

The PR removes redundant normalization around fixed memory-search defaults and adds coverage that successive resolver calls return isolated default objects.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No patch defect found: the cleanup preserves the fixed defaults, their downstream consumption, and fresh returned objects; current main has not subsumed it, and this maintainer-authored PR remains open for normal merge handling.

Priority: P3
Reviewed head: cf09447ab10d08d86c580060ed40a4d70b02eab9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative refactor with a preserved configuration contract and useful isolation coverage.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, behavior-neutral refactor has focused resolver and real-manager test evidence in the PR body; the external-contributor proof gate does not apply.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored, behavior-neutral refactor has focused resolver and real-manager test evidence in the PR body; the external-contributor proof gate does not apply.
Evidence reviewed 6 items Configuration contract: The public type exposes only remote batch enablement and query max-results/min-score; the runtime schema is strict, and retired chunking, sync, hybrid, batch-timing, and cache-cap keys are explicitly rejected.
Resolver behavior: The PR replaces helper calls that always received undefined with the same named defaults, preserves the configurable minimum-score clamp, and constructs new nested objects per resolver call.
Downstream owner: Memory Core consumes the resolved batch fields, including its timer-bound conversion, before passing them to the provider batch operation; the direct values remain 2000 ms and 60 minutes.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs src/agents/memory-search.test.ts

Result: PASS (completed)

[test] starting test/vitest/vitest.unit-fast.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-130655-7UWX8G/target

 ✓  unit-fast  src/agents/memory-search.test.ts (46 tests) 15ms

 Test Files  1 passed (1)
      Tests  46 passed (46)
   Start at  03:42:35
   Duration  6.90s (transform 5.47s, setup 84ms, import 6.69s, tests 15ms, environment 0ms)

[test] passed 1 Vitest shard in 14.49s
[test] starting test/vitest/vitest.unit-fast.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-130655-7UWX8G/target

 ✓  unit-fast  src/agents/memory-search.test.ts (46 tests) 15ms

 Test Files  1 passed (1)
      Tests  46 passed (46)
   Start at  03:42:50
   Duration  3.04s (transform 1.75s, setup 25ms, import 2.90s, tests 15ms, environment 0ms)

[test] passed 1 Vitest shard in 10.51s

Assertions:

  • PASS expect_output: memory-search.test.ts

How this fits together

The memory-search resolver combines user-configurable provider and query settings with fixed indexing defaults. Its result feeds the Memory Core plugin’s indexing, batch embedding, sync, diagnostics, and search behavior.

flowchart LR
  A[OpenClaw configuration] --> B[Memory-search resolver]
  C[Fixed indexing defaults] --> B
  B --> D[Resolved search settings]
  D --> E[Memory Core manager]
  E --> F[Batch embedding]
  E --> G[Sync and search]
Loading

Before merge

  • Complete next step (P2) - No repair job is warranted because no concrete patch defect was found; this remains a normal maintainer merge review.
Agent review details

Security

None.

PR surface

Source -74, Tests +1. Total -73 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 10 84 -74
Tests 1 18 17 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 28 101 -73

Review metrics

Metric Value Why it matters
Production versus test delta production -74 lines; tests +1 line The refactor substantially removes redundant production normalization while adding targeted mutation-isolation coverage.

Stored data model

Persistent data-model change detected: persistent cache schema: src/agents/memory-search.test.ts, unknown-data-model-change: src/agents/memory-search.ts, vector/embedding metadata: src/agents/memory-search.test.ts, vector/embedding metadata: src/agents/memory-search.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Land the direct fixed-default implementation once the exact PR head completes the normal repository merge gates.

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

Not applicable: this PR is a behavior-preserving cleanup, and the relevant resolver contract is covered by focused source and test evidence.

Is this the best way to solve the issue?

Yes: direct construction is the smallest maintainable implementation because the removed values are fixed internally and their former configuration paths are rejected by the schema.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a behavior-neutral internal cleanup with no new configuration surface or user-visible workflow change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Label justifications:

  • P3: This is a behavior-neutral internal cleanup with no new configuration surface or user-visible workflow change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Evidence

What I checked:

  • Configuration contract: The public type exposes only remote batch enablement and query max-results/min-score; the runtime schema is strict, and retired chunking, sync, hybrid, batch-timing, and cache-cap keys are explicitly rejected. (src/config/types.memory.ts:44, cf09447ab10d)
  • Resolver behavior: The PR replaces helper calls that always received undefined with the same named defaults, preserves the configurable minimum-score clamp, and constructs new nested objects per resolver call. (src/agents/memory-search.ts:212, cf09447ab10d)
  • Downstream owner: Memory Core consumes the resolved batch fields, including its timer-bound conversion, before passing them to the provider batch operation; the direct values remain 2000 ms and 60 minutes. (extensions/memory-core/src/memory/manager-sync-ops.ts:393, cf09447ab10d)
  • Regression coverage: The revised test mutates every newly direct nested default and verifies both a fresh full resolution and the sync-only resolution remain unchanged. (src/agents/memory-search.test.ts:520, cf09447ab10d)
  • Current-main and feature provenance: Current main still contains the pre-cleanup helper calls, while blame attributes the resolver’s fixed defaults to the initial resolver commit from the same area owner. (src/agents/memory-search.ts:241, 31b26d09f050)
  • Release status: No release tag contains the unmerged PR head, so this cleanup is neither on current main nor shipped. (cf09447ab10d)

Likely related people:

  • steipete: Commit 31b26d0 introduced the current memory-search resolver and its fixed defaults; the same contributor authored this focused cleanup. (role: current resolver introducer and recent area contributor; confidence: high; commits: 31b26d09f050, cf09447ab10d; files: src/agents/memory-search.ts, src/agents/memory-search.test.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

@steipete
steipete merged commit 30e7ecb into main Aug 27, 2026
267 checks passed
@steipete
steipete deleted the codex/cleanup20k-memory-fixed-defaults-20260826 branch August 27, 2026 04:01
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant