feat: per-agent isolation for skills, mode, and evolution#50
feat: per-agent isolation for skills, mode, and evolution#50OctoClaws wants to merge 1 commit intoaiming-lab:mainfrom
Conversation
Add X-Agent-Id header propagation from OpenClaw plugin to MetaClaw proxy,
enabling per-agent isolation across multiple dimensions:
- Per-agent skill directories: each agent gets its own skill subdirectory
under skills_dir/{agent_id}/, with a shared _shared/ directory merged in
- Per-agent mode routing: agents can independently use skills_only or rl
mode via the new agents config section
- Per-agent skill evolution: SkillEvolver writes new skills to the correct
agent's subdirectory
- Per-agent SkillManager cache: avoids recreating managers on every request
Config example (config.yaml):
agents:
agent-a:
mode: skills_only
agent-b:
mode: rl
Backward compatible: if no X-Agent-Id header is sent or no agents config
exists, all behavior falls back to the existing single-agent mode.
Closes aiming-lab#49
|
Hi @OctoClaws, Thanks for the PR! The overall design is solid. Two issues before we can merge:
Happy to help review a follow-up once these are addressed. |
Summary
Adds per-agent isolation to MetaClaw, enabling multi-agent deployments where each agent has independent skills, operating mode, and evolution pipeline.
Closes #49
Changes
1.
extensions/metaclaw-openclaw/index.ts(+2 lines)X-Agent-Idheader from OpenClaw'sctx.agentIdalongside existingX-Session-IdandX-Turn-Type2.
metaclaw/config.py(+10 lines)agents: dictfield toMetaClawConfigfor per-agent overridesmode,skills_dir,lora_outputper agent3.
metaclaw/api_server.py(+133 lines, -25 lines)X-Agent-Idheader inchat_completionsendpoint_get_agent_skill_manager(agent_id)method:SkillManagerinstances{skills_dir}/{agent_id}/+{skills_dir}/_shared/skills_onlyvsrlper agent from configagent_idfor correct directory targeting_inject_skills()and_inject_augmentation()accept optionalskill_managerparameterConfig Example
Directory Structure
Backward Compatibility
X-Agent-Idheader β falls back to_defaultagent β existing behavioragentsconfig section β all agents share global config β existing behaviorskills/directory works as-is for single-agent setups