openclaw - 💡(How to fix) Fix Feature: Per-agent plugin configuration overrides for multi-agent setups [1 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#55401Fetched 2026-04-08 01:40:00
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
cross-referenced ×1

Code Example

{
  "agents": {
    "list": [
      {
        "id": "misha",
        "name": "MishaClaw",
        "plugins": {
          "openclaw-mem0": {
            "config": {
              "apiKey": "different-key",
              "userId": "misha-cittadini"
            }
          }
        }
      }
    ]
  }
}
RAW_BUFFERClick to expand / collapse

Problem

In a multi-agent setup (e.g., two agents on one OpenClaw instance), plugins like openclaw-mem0 use a single global config. This means all agents share the same plugin settings — there's no way to give different agents different plugin configurations.

Real-world example

I run two agents:

  • CittadiniClaw (main) — should use Mem0 with userId: david-cittadini
  • MishaClaw (misha) — should use Mem0 with a different API key and userId: misha-cittadini pointing to a separate Mem0 project

Currently, the openclaw-mem0 plugin works around this by auto-appending the agent ID to the base userId (e.g., david-cittadini:agent:misha), which provides namespace separation within the same store. However, this means both agents must share the same Mem0 project/API key — there's no way to route one agent to a completely separate Mem0 account.

What I Tried

  1. Adding plugins key to the agent entry in agents.list[] → rejected by config schema (Unrecognized key: "plugins")
  2. Adding agents.misha.plugins at the top level → rejected (Unrecognized key: "misha")

Proposed Solution

Allow per-agent plugin config overrides in the agent definition, e.g.:

{
  "agents": {
    "list": [
      {
        "id": "misha",
        "name": "MishaClaw",
        "plugins": {
          "openclaw-mem0": {
            "config": {
              "apiKey": "different-key",
              "userId": "misha-cittadini"
            }
          }
        }
      }
    ]
  }
}

The agent-level plugin config would be deep-merged with the global plugin config, so you only override what's different.

Use Cases

  • Mem0: Separate memory stores per agent (different users, different projects)
  • Any plugin with user-specific config (voice, TTS, model preferences)
  • Billing separation: Route different agents to different API accounts

Environment

  • OpenClaw 2026.3.24
  • Plugin: openclaw-mem0 v0.4.0
  • Multi-agent setup with 2 agents (main + misha)

extent analysis

Fix Plan

To implement per-agent plugin config overrides, follow these steps:

  • Update the OpenClaw configuration schema to allow a plugins key within each agent definition in agents.list[].
  • Modify the openclaw-mem0 plugin to support deep-merging of agent-level config overrides with the global plugin config.

Example code changes:

// Updated config schema
{
  "type": "object",
  "properties": {
    "agents": {
      "type": "object",
      "properties": {
        "list": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {"type": "string"},
              "name": {"type": "string"},
              "plugins": { // Added plugins key
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "config": {"type": "object"}
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
// Deep-merge function for agent-level config overrides
function deepMerge(target, source) {
  if (typeof target !== 'object' || typeof source !== 'object') {
    return source;
  }
  for (const key in source) {
    if (Object.prototype.hasOwnProperty.call(source, key)) {
      if (typeof source[key] === 'object' && source[key] !== null) {
        if (!target[key]) {
          target[key] = {};
        }
        deepMerge(target[key], source[key]);
      } else {
        target[key] = source[key];
      }
    }
  }
  return target;
}

// Example usage in openclaw-mem0 plugin
const globalConfig = {
  apiKey: 'default-key',
  userId: 'default-user'
};

const agentConfig = {
  plugins: {
    'openclaw-mem0': {
      config: {
        apiKey: 'different-key',
        userId: 'misha-cittadini'
      }
    }
  }
};

const mergedConfig = deepMerge({}, globalConfig);
deepMerge(mergedConfig, agentConfig.plugins['openclaw-mem0'].config);
console.log(mergedConfig); // Output: { apiKey: 'different-key', userId: 'misha-cittadini' }

Verification

To verify the fix, create a test configuration with different plugin settings for each agent and check that the openclaw-mem0 plugin uses the correct configuration for each agent.

Extra Tips

  • Make sure to update the documentation for the openclaw-mem0 plugin to reflect the new configuration options.
  • Consider adding validation for the plugins key in the agent definition to ensure that only supported plugins are configured.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Feature: Per-agent plugin configuration overrides for multi-agent setups [1 participants]