Skip to content

Sync upstream and keep MongoDB-only memory - #1

Merged
cursor[bot] merged 10000 commits into
mainfrom
cursor/upstream-memongo-sync-baf0
May 13, 2026
Merged

Sync upstream and keep MongoDB-only memory#1
cursor[bot] merged 10000 commits into
mainfrom
cursor/upstream-memongo-sync-baf0

Conversation

@romiluz13

@romiluz13 romiluz13 commented May 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Problem: ClawMongo had fallen behind upstream OpenClaw while carrying MongoDB-only memory and custom identity/skills/prompts.
  • Why it matters: the fork needs current upstream platform changes without losing ClawMongo identity or reintroducing non-Mongo runtime memory fallbacks.
  • What changed: merged current upstream, kept MongoDB as the runtime memory contract, added atlas-local-preview and atlas-cloud profile handling, restored ClawMongo identity/skills/template guidance, wired MongoDB memory tools into the current upstream tool registry, added a local Memongo-style bridge facade, added recall trace and memory job primitives, restored plugin/test compatibility needed by the upstream suite, and added a real E2E preflight script that requires MongoDB URI plus Voyage credentials.
  • What did NOT change (scope boundary): live Atlas Local Preview / Atlas cloud proof was not run because this cloud environment has no Docker, MongoDB CLI/server, Atlas CLI, or MongoDB URI env vars.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #
  • Related #
  • This PR fixes a bug or regression

Real behavior proof (required for external PRs)

  • Behavior or issue addressed: upstream sync with preserved ClawMongo identity and MongoDB-only memory contract.
  • Real environment tested: Linux cloud workspace, Node/pnpm repo tests.
  • Exact steps or command run after this patch: pnpm check, pnpm build, targeted Mongo/plugin/gateway/command tests, repeated full pnpm test attempts, pnpm clawmongo:e2e preflight.
  • Evidence after fix: command output from local gates on this branch.
  • Observed result after fix: check/build and many targeted suites pass; full suite is substantially improved but still not green; real E2E preflight correctly stops on missing MongoDB URI in this environment.
  • What was not tested: live local preview and Atlas cloud runtime proof due unavailable Docker/MongoDB/Atlas runtime and missing MongoDB URI env vars.
  • Before evidence: initial targeted tests failed on stale MongoDB query-cache mock, missing deps after upstream merge, plugin slot expectations, gateway container bind behavior, lost identity/skill files, and several full-suite drift points.

Root Cause (if applicable)

  • Root cause: N/A.
  • Missing detection / guardrail: N/A.
  • Contributing context (if known): upstream OpenClaw advanced significantly while ClawMongo carried a MongoDB memory fork and custom user-facing identity files.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: memory backend config, schema/index generation, memory tools, gateway memory startup, plugin slot behavior, onboarding/configure memory, real E2E preflight.
  • Scenario the test should lock in: MongoDB-only memory across Atlas Local Preview and Atlas cloud profiles while preserving ClawMongo identity.
  • Why this is the smallest reliable guardrail: profile/tool/plugin tests cover static contracts; E2E preflight covers required real-world credentials/runtime; live Mongo tests remain optional until credentials exist.
  • Existing test that already covers this (if any): src/memory/backend-config.test.ts, src/memory/mongodb-schema.test.ts, src/agents/tools/memory-tool-mongodb.test.ts, src/memory/mongodb-manager.test.ts, src/gateway/server-startup-memory.test.ts, src/plugins/memory-runtime.test.ts, src/plugins/uninstall.test.ts, src/commands/configure-memory.test.ts.
  • If no new test is added, why not: N/A.

User-visible / Behavior Changes

ClawMongo memory is explicitly MongoDB-only with atlas-local-preview and atlas-cloud deployment profiles. community-mongot remains accepted as a compatibility alias for atlas-local-preview. Workspace templates now state MongoDB is durable runtime memory. pnpm clawmongo:e2e validates that MongoDB and Voyage credentials are present before attempting a real memory proof.

Diagram (if applicable)

Before:
OpenClaw upstream -> multiple memory backends and fallback paths

After:
OpenClaw upstream -> ClawMongo MongoDB-only memory tools/bridge -> Atlas Local Preview or Atlas cloud

Security Impact (required)

  • New permissions/capabilities? (Yes/No) No
  • Secrets/tokens handling changed? (Yes/No) Yes
  • New/changed network calls? (Yes/No) Yes
  • Command/tool execution surface changed? (Yes/No) Yes
  • Data access scope changed? (Yes/No) Yes
  • If any Yes, explain risk + mitigation: MongoDB URI/profile handling expands to Atlas cloud. Secrets remain config/env supplied; docs use placeholders; runtime validates missing URI/profile/search/Voyage capability instead of falling back to non-Mongo memory.

Repro + Verification

Environment

  • OS: Linux cloud agent
  • Runtime/container: Node/pnpm workspace
  • Model/provider: N/A
  • Integration/channel (if any): MongoDB memory
  • Relevant config (redacted): no live MongoDB credentials configured

Steps

  1. pnpm test src/memory/backend-config.test.ts src/memory/mongodb-schema.test.ts src/agents/tools/memory-tool-mongodb.test.ts src/memory/mongodb-manager.test.ts src/gateway/server-startup-memory.test.ts src/plugins/memory-runtime.test.ts src/plugins/uninstall.test.ts test/scripts/test-live-shard.test.ts
  2. pnpm test src/gateway/server.auth.control-ui.test.ts src/gateway/server.auth.compat-baseline.test.ts src/gateway/server.auth.modes.test.ts src/gateway/server.health.test.ts src/gateway/server.node-invoke-approval-bypass.test.ts src/gateway/server.config-patch.test.ts src/gateway/server.chat.gateway-server-chat.test.ts
  3. pnpm test extensions/bonjour/src/advertiser.test.ts
  4. pnpm test src/commands/configure-memory.test.ts src/commands/doctor-memory-recall-diagnostic.test.ts src/commands/onboard-hooks.test.ts src/commands/status.scan.shared.test.ts src/commands/doctor/shared/stale-plugin-config.test.ts extensions/memory-core/index.test.ts extensions/memory-lancedb/config.test.ts extensions/nvidia/onboard.test.ts extensions/lmstudio/src/setup.test.ts src/cli/gateway-cli/run.option-collisions.test.ts src/gateway/server.startup-websocket-race.test.ts
  5. pnpm test test/web-provider-boundary.test.ts test/scripts/lint-suppressions.test.ts ui/src/ui/controllers/chat.test.ts extensions/active-memory/index.test.ts src/auto-reply/reply/reply-state.test.ts extensions/acpx/src/config.test.ts extensions/telegram/src/bot.create-telegram-bot.test.ts src/agents/pi-auth-json.test.ts src/agents/pi-settings.test.ts src/agents/pi-tools.workspace-only-false.test.ts src/agents/workspace.test.ts
  6. pnpm check
  7. pnpm build
  8. pnpm clawmongo:e2e preflight
  9. pnpm test attempted as broad gate.

Expected

  • ClawMongo agent runtime compiles with MongoDB-only memory and current upstream OpenClaw.

Actual

  • Targeted tests, check, and build passed.
  • pnpm clawmongo:e2e correctly failed fast because no MongoDB URI was configured in this cloud environment.
  • Full pnpm test still did not pass. The latest full-suite attempt is much closer but still has additional unit-fast/plugin metadata and generated-contract failures that need a continued full-suite stabilization pass before main.

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

  • Verified scenarios: upstream merge conflict resolution, preservation audit, ClawMongo templates/skills restoration, MongoDB profile resolution, MongoDB schema/index tests, memory tool tests, gateway memory startup tests, plugin slot behavior, onboarding/configure memory tests, gateway auth tests, repo check, build, E2E preflight, and a large subset of prior full-suite failures.
  • Edge cases checked: missing MongoDB URI errors; missing Voyage key is now an explicit E2E blocker after URI; Atlas SRV URI infers atlas-cloud; community-mongot aliases to atlas-local-preview; test-minimal gateway mode binds loopback in containerized test environments.
  • What you did not verify: live Atlas Local Preview / Atlas cloud agent runtime because Docker and MongoDB credentials were unavailable; full pnpm test green.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? (Yes/No) Partially
  • Config/env changes? (Yes/No) Yes
  • Migration needed? (Yes/No) Yes
  • If yes, exact upgrade steps: configure memory.mongodb.uri; set memory.mongodb.deploymentProfile to atlas-local-preview or atlas-cloud; keep memory.mongodb.embeddingMode as automated; provide Voyage credentials to MongoDB Search/mongot; optionally set memory.mongodb.autoEmbedModel for the target cluster.

Risks and Mitigations

  • Risk: full test suite still has non-target failures after the upstream sync.
    • Mitigation: keep PR draft until full-suite stabilization and live Mongo proof are completed.
  • Risk: Atlas cloud autoEmbed model support may differ from local preview.
    • Mitigation: profile-aware defaults, explicit autoEmbedModel config, and E2E preflight requiring MongoDB plus Voyage credentials.
  • Risk: secrets could leak through local testing.
    • Mitigation: do not commit credentials; E2E script reads env vars only and docs use placeholders.
Open in Web Open in Cursor 

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants