Summary
The plugin currently shares a single config (API key, workspace ID, noise patterns, behavioral settings) across all agents. Each persistent agent gets its own Honcho peer for basic memory separation, but subagents get limited context (no full session history), and there's no way to give individual agents different workspaces, credentials, or behavioral settings.
Community request: users running multi-agent OpenClaw setups want each agent to have full independent Honcho access.
Proposed changes
1. Config: add agents map with per-agent overrides
{
"apiKey": "${HONCHO_API_KEY}",
"workspaceId": "openclaw",
"agents": {
"main": {},
"sales": { "workspaceId": "sales-team", "ownerObserveOthers": true },
"coding": { "crossSessionSearch": false, "noisePatterns": ["BUILD_OK"] }
}
}
Agents without overrides inherit the base config. Overridable fields: workspaceId, apiKey, baseUrl, timeoutMs, noisePatterns, disableDefaultNoisePatterns, ownerObserveOthers, crossSessionSearch.
New types in config.ts:
AgentConfigOverrides — partial subset of HonchoConfig
resolveForAgent(base, agentId) — merges base + agent overrides
2. State: AgentContext abstraction
Replace the pattern of separately calling state.getAgentPeer(), state.honcho, state.ownerPeer, and state.cfg with a single getAgentContext(agentId) that returns:
type AgentContext = {
honcho: Honcho; // correct client for this agent's workspace
cfg: HonchoConfig; // resolved config (base + overrides)
ownerPeer: Peer;
agentPeer: Peer;
};
Honcho clients are created lazily and deduped — agents sharing the same workspaceId + apiKey + baseUrl share a client.
3. Tools: convert static tools to factory pattern
honcho_context and honcho_search_conclusions currently use static registration (no toolCtx.agentId). Convert to factory pattern so all tools resolve the correct AgentContext.
4. Update openclaw.plugin.json schema
Add agents property with additionalProperties schema matching the overridable fields.
Files affected
| File |
Change |
config.ts |
AgentConfigOverrides type, agents field, resolveForAgent() |
state.ts |
AgentContext type, clients map, getAgentContext() |
tools/context.ts |
Static → factory pattern |
tools/search.ts |
Static → factory pattern |
tools/ask.ts |
Use getAgentContext |
tools/session.ts |
Use getAgentContext |
tools/message-search.ts |
Use getAgentContext |
tools/memory-passthrough.ts |
Use getAgentContext |
hooks/context.ts |
Use getAgentContext |
hooks/capture.ts |
Use getAgentContext |
runtime.ts |
Use getAgentContext |
openclaw.plugin.json |
Add agents to schema |
Summary
The plugin currently shares a single config (API key, workspace ID, noise patterns, behavioral settings) across all agents. Each persistent agent gets its own Honcho peer for basic memory separation, but subagents get limited context (no full session history), and there's no way to give individual agents different workspaces, credentials, or behavioral settings.
Community request: users running multi-agent OpenClaw setups want each agent to have full independent Honcho access.
Proposed changes
1. Config: add
agentsmap with per-agent overrides{ "apiKey": "${HONCHO_API_KEY}", "workspaceId": "openclaw", "agents": { "main": {}, "sales": { "workspaceId": "sales-team", "ownerObserveOthers": true }, "coding": { "crossSessionSearch": false, "noisePatterns": ["BUILD_OK"] } } }Agents without overrides inherit the base config. Overridable fields:
workspaceId,apiKey,baseUrl,timeoutMs,noisePatterns,disableDefaultNoisePatterns,ownerObserveOthers,crossSessionSearch.New types in
config.ts:AgentConfigOverrides— partial subset ofHonchoConfigresolveForAgent(base, agentId)— merges base + agent overrides2. State:
AgentContextabstractionReplace the pattern of separately calling
state.getAgentPeer(),state.honcho,state.ownerPeer, andstate.cfgwith a singlegetAgentContext(agentId)that returns:Honcho clients are created lazily and deduped — agents sharing the same
workspaceId + apiKey + baseUrlshare a client.3. Tools: convert static tools to factory pattern
honcho_contextandhoncho_search_conclusionscurrently use static registration (notoolCtx.agentId). Convert to factory pattern so all tools resolve the correctAgentContext.4. Update
openclaw.plugin.jsonschemaAdd
agentsproperty withadditionalPropertiesschema matching the overridable fields.Files affected
config.tsAgentConfigOverridestype,agentsfield,resolveForAgent()state.tsAgentContexttype,clientsmap,getAgentContext()tools/context.tstools/search.tstools/ask.tsgetAgentContexttools/session.tsgetAgentContexttools/message-search.tsgetAgentContexttools/memory-passthrough.tsgetAgentContexthooks/context.tsgetAgentContexthooks/capture.tsgetAgentContextruntime.tsgetAgentContextopenclaw.plugin.jsonagentsto schema