💭 feat: Require Explicit Auto-agent Enablement for Memories#12886
Conversation
There was a problem hiding this comment.
Pull request overview
Adjusts the memory feature so manual memories/personalization can remain enabled without implicitly enabling the legacy “automatic memory-agent” pipeline, requiring an explicit opt-in flag to run the memory agent and to fan memory context out to parallel agents.
Changes:
- Changes “memory enabled” semantics to only depend on
memory.disabled, and addsisMemoryAgentEnabled()gated bymemory.agent.enabled === true. - Updates agent run context so memory context is primary-only by default; legacy opt-in restores parallel-agent memory fan-out.
- Updates schema, tests, and example YAML to document/verify the explicit enablement behavior.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/data-schemas/src/app/memory.ts | Updates enablement logic and introduces isMemoryAgentEnabled() for explicit auto-agent opt-in. |
| packages/data-schemas/src/app/interface.ts | Aligns UI-disable comment/logic with “explicitly disabled only” semantics. |
| packages/data-provider/src/config.ts | Extends memory.agent schema to accept optional enabled. |
| packages/api/src/memory/config.ts | Mirrors data-schemas memory enablement changes and adds isMemoryAgentEnabled(). |
| packages/api/src/memory/config.spec.ts | Adds tests covering manual-memory enabled vs. auto-agent explicit opt-in behavior. |
| packages/api/src/app/permissions.ts | Updates wording to reflect “configured” vs. “valid agent” semantics. |
| packages/api/src/app/permissions.spec.ts | Updates expectations to match new “no agent required” memory config behavior. |
| librechat.example.yaml | Documents that auto memory-agent flow requires memory.agent.enabled: true. |
| api/server/controllers/agents/client.test.js | Updates/extends tests for primary-only memory context by default and legacy opt-in fan-out; adds getFormattedMemories mocking. |
| api/server/controllers/agents/client.js | Gates memory processing on isMemoryAgentEnabled; loads existing memories without auto-processing when not enabled; keeps memory context primary-only unless legacy opt-in. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
GitNexus: 🚀 deployedThe |
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
cfb6b59 to
5f4ec36
Compare
GitNexus: 🚀 deployedThe |
5f4ec36 to
024efe1
Compare
GitNexus: 🚀 deployedThe |
Summary
memory.agent.enabled: trueopt-in for automatic memory-agent updates@librechat/data-schemasand warn on old agent config without explicit enablementTests
npm run build -w @librechat/data-schemasnpm run build -w @librechat/apicd packages/api && npx jest src/memory/config.spec.ts src/app/permissions.spec.ts --runInBandcd api && npx jest server/controllers/agents/client.test.js --runInBand