feat(tools): add standalone MoA (mixture of agents) runner - #40927
Open
patrickpassosb wants to merge 1 commit into
Open
feat(tools): add standalone MoA (mixture of agents) runner#40927patrickpassosb wants to merge 1 commit into
patrickpassosb wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of the verified MOA (Mixture of Agents) wrapper into opencode as standalone tooling under
tools/moa/(source: security-lab-workflowfm/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 + tracestools/moa/moa.yaml— captain-test preset defaultstools/moa/tests/— 26 tests (mocked network, no live quota)tools/moa/README.md+requirements.txtBehavior
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(defaulthttp://ai.tail492ce8.ts.net/v1, fallbackOLLAMA_API_BASE) +MOA_API_KEY(fallbackOLLAMA_API_KEY; defaultnot-required). No hardcoded keys.Design constraints honored
src/,packages/)labutil.audit()) is now a local best-effort JSONL append (tools/moa/audit/moa-run.jsonl,MOA_AUDIT_LOGoverride)Verification
python3 -m pytest tools/moa/tests→ 26 passed.