#8252: Config: honor legacy memorySearch alias
docs
size: S
Cluster:
Model Alias Fixes
## Summary
- accept top-level `memorySearch` in config schema and merge it into `agents.defaults.memorySearch` when defaults are missing
- add unit coverage for legacy alias mapping behavior
- note the canonical config location in memory docs
## Testing
- `pnpm vitest run --config vitest.unit.config.ts src/config/config.memory-search-legacy-alias.test.ts`
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds support for a legacy config alias `memorySearch` at the top level of the OpenClaw config. The schema now accepts `memorySearch`, `applyAgentDefaults` merges it into `agents.defaults.memorySearch` only when `agents.defaults.memorySearch` is not already set, and unit tests cover both the merge behavior and the non-overriding case. Documentation is updated to point users at the canonical `agents.defaults.memorySearch` location while noting the legacy alias.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- Changes are narrowly scoped to config schema acceptance and default-merging logic for a legacy alias, with explicit unit tests validating the intended precedence rules. The new top-level schema field is optional and the merge only occurs when canonical defaults are absent.
- No files require special attention
<!-- greptile_other_comments_section -->
<sub>(5/5) You can turn off certain types of comments like style [here](https://app.greptile.com/review/github)!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
## AI-Assisted
Yes — implemented and reviewed with AI assistance.
## Local Validation
```bash
pnpm build && pnpm check && pnpm test
```
All tests pass. TypeScript compilation clean. Lint passes.
Most Similar PRs
#9678: Cross-agent memory read allowlist
by Helmi · 2026-02-05
78.2%
#16104: fix: implement model aliases for /model command
by MisterGuy420 · 2026-02-14
77.4%
#2884: fix: Create memory directory and symlink identity files during work...
by webdevtodayjason · 2026-01-27
75.3%
#21217: fix: memory prune command to prevent unbounded MEMORY.md growth
by theognis1002 · 2026-02-19
75.1%
#10644: feat: add runDuringHeartbeats option for memory flush (AI Assisted)
by tripphillips · 2026-02-06
74.6%
#4767: fix(agents): handle read alias required schema
by RomeroYang · 2026-01-30
74.0%
#6060: feat(onboarding): add Memory Optimization step to onboarding wizard
by GodsBoy · 2026-02-01
73.7%
#16657: feat(memory-lancedb): add memory CLI command alias
by ciberponk · 2026-02-15
73.7%
#11761: fix(gateway): expose memory/ directory files in agents.files RPC
by advaitpaliwal · 2026-02-08
73.6%
#14934: fix: add mistral to MemorySearchSchema provider/fallback unions
by ThomsenDrake · 2026-02-12
73.4%