Skip to content

feat(tools): add standalone MoA (mixture of agents) runner - #40927

Open
patrickpassosb wants to merge 1 commit into
anomalyco:devfrom
patrickpassosb:fm/oc-moa-opencode-port-v1
Open

feat(tools): add standalone MoA (mixture of agents) runner#40927
patrickpassosb wants to merge 1 commit into
anomalyco:devfrom
patrickpassosb:fm/oc-moa-opencode-port-v1

Conversation

@patrickpassosb

Copy link
Copy Markdown

Port of the verified MOA (Mixture of Agents) wrapper into opencode as standalone tooling under tools/moa/ (source: security-lab-workflow fm/oc-moa-wrapper-v1, 26 passing tests). The security-lab lane ships the same wrapper in parallel — both repos carry it for now, to be revisited later.

What's included

  • tools/moa/bin/moa-run — CLI entry (Python3 shebang)
  • tools/moa/lib/moa.py — config + stdlib-urllib OpenAI-compatible client + thread-pool fan-out + aggregator synthesis + traces
  • tools/moa/moa.yaml — captain-test preset defaults
  • tools/moa/tests/ — 26 tests (mocked network, no live quota)
  • tools/moa/README.md + requirements.txt
  • Root README section + .gitignore entries for traces/audit/venv

Behavior

Fans a task prompt to advisor models in parallel (ollama-cloud/glm-5.2, ollama-cloud/minimax-m3), then aggregates their analyses plus the original task into a final verdict (ollama-cloud/deepseek-v4-flash:0731, reasoning_effort=max). Route: MOA_BASE_URL (default http://ai.tail492ce8.ts.net/v1, fallback OLLAMA_API_BASE) + MOA_API_KEY (fallback OLLAMA_API_KEY; default not-required). No hardcoded keys.

Design constraints honored

  • Additive only: no changes to opencode core (src/, packages/)
  • Self-contained: no security-lab imports — the CLI's audit hook (previously labutil.audit()) is now a local best-effort JSONL append (tools/moa/audit/moa-run.jsonl, MOA_AUDIT_LOG override)
  • Ported faithfully, no redesign

Verification

python3 -m pytest tools/moa/tests → 26 passed.

Port of the verified MOA wrapper (security-lab-workflow fm/oc-moa-wrapper-v1)
into tools/moa: fans a task prompt to advisor models in parallel
(ollama-cloud/glm-5.2, ollama-cloud/minimax-m3), then aggregates their
analyses into a final verdict (ollama-cloud/deepseek-v4-flash:0731,
reasoning_effort=max). Route via MOA_BASE_URL / MOA_API_KEY with
OLLAMA_API_BASE / OLLAMA_API_KEY fallbacks; no hardcoded keys. Stdlib-only
HTTP (urllib), thread-pool fan-out, per-advisor failure isolation, JSON
traces for audit. Self-contained: no opencode core or security-lab imports
(CLI audit log is local). 26 tests mock chat_completions - no live quota.
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