Skip to content

feat: per-agent plugin configuration overrides #63

Description

@ajspig

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions