Skip to content

feat: add multi-agent support via dm-agent-sync plugin#23

Merged
chubes4 merged 1 commit intomainfrom
feat/multi-agent-support
Apr 7, 2026
Merged

feat: add multi-agent support via dm-agent-sync plugin#23
chubes4 merged 1 commit intomainfrom
feat/multi-agent-support

Conversation

@chubes4
Copy link
Copy Markdown
Member

@chubes4 chubes4 commented Apr 7, 2026

Summary

Adds generic multi-agent support so that all Data Machine agents automatically surface in OpenCode's agent switcher with full identity, memory, and tool context.

What's included

1. kimaki/plugins/dm-agent-sync.ts — New OpenCode plugin that:

  • Queries wp datamachine agents list for all active agents at session start
  • Resolves file paths via wp datamachine agent paths per agent
  • Registers each as an OpenCode agent with layered prompt (AGENTS.md → SITE.md → SOUL.md → MEMORY.md → USER.md)
  • Maps agent_config.default_model to OpenCode model config
  • Maps agent_config.tool_policy to OpenCode tool permissions
  • Respects user overrides in opencode.json (doesn't clobber explicit model choices)
  • No-ops gracefully when Data Machine is unavailable

2. setup.sh Phase 7 update — Includes dm-agent-sync.ts in the generated plugin array alongside dm-context-filter.ts

Architecture

Data Machine (brain)          →  Agent database, SOUL.md, MEMORY.md, tool policies
    ↓ WP-CLI queries
dm-agent-sync.ts (plugin)     →  Reads DM agents, registers in OpenCode
    ↓ config hook
OpenCode (runtime)            →  User sees all agents in agent switcher

Backward compatibility

  • Zero agents: plugin is a silent no-op
  • One agent: updates build/plan prompts to ensure file paths are current
  • Multiple agents: registers each by slug + populates build/plan defaults from first agent

Depends on

Add dm-agent-sync.ts — an OpenCode plugin that dynamically discovers all
Data Machine agents at session start and registers them in the agent
switcher with correct identity files and memory context.

The plugin:
- Queries 'wp datamachine agents list' for all active agents
- Resolves file paths via 'wp datamachine agent paths' per agent
- Registers each as an OpenCode agent with layered prompt (AGENTS.md,
  SITE.md, SOUL.md, MEMORY.md, USER.md)
- Respects user overrides in opencode.json
- No-ops gracefully when Data Machine is unavailable

Also updates setup.sh Phase 7 to include dm-agent-sync.ts in the
generated plugin array alongside dm-context-filter.ts.
@chubes4 chubes4 merged commit caa74f1 into main Apr 7, 2026
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.

1 participant