{"id":37383464,"url":"https://github.com/agnusdei1207/opencode-orchestrator","last_synced_at":"2026-06-01T02:02:14.700Z","repository":{"id":332242893,"uuid":"1133169851","full_name":"agnusdei1207/opencode-orchestrator","owner":"agnusdei1207","description":"Opencode Plugin for AI-Agent Orchestration","archived":false,"fork":false,"pushed_at":"2026-01-29T02:59:48.000Z","size":44955,"stargazers_count":91,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-26T16:50:53.606Z","etag":null,"topics":["ai-orchestration","opencode","rust"],"latest_commit_sha":null,"homepage":"https://rdot.agnusdei.kr/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agnusdei1207.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-13T01:25:07.000Z","updated_at":"2026-02-26T15:33:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/agnusdei1207/opencode-orchestrator","commit_stats":null,"previous_names":["agnusdei1207/opencode-orchestrator"],"tags_count":332,"template":false,"template_full_name":null,"purl":"pkg:github/agnusdei1207/opencode-orchestrator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agnusdei1207%2Fopencode-orchestrator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agnusdei1207%2Fopencode-orchestrator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agnusdei1207%2Fopencode-orchestrator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agnusdei1207%2Fopencode-orchestrator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agnusdei1207","download_url":"https://codeload.github.com/agnusdei1207/opencode-orchestrator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agnusdei1207%2Fopencode-orchestrator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29943831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T13:49:17.081Z","status":"ssl_error","status_checked_at":"2026-02-28T13:48:50.396Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-orchestration","opencode","rust"],"created_at":"2026-01-16T05:14:56.907Z","updated_at":"2026-06-01T02:02:14.690Z","avatar_url":"https://github.com/agnusdei1207.png","language":"TypeScript","funding_links":[],"categories":["Multi-Agent \u0026 Orchestration"],"sub_categories":["Other IDEs"],"readme":"\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/logo.png\" alt=\"logo\" width=\"200\" /\u003e\n  \u003ch1\u003eOpenCode Orchestrator\u003c/h1\u003e\n  \u003cp\u003eProduction-Grade Multi-Agent Orchestration Engine for High-Integrity Software Engineering\u003c/p\u003e\n\n  [![MIT License](https://img.shields.io/badge/license-MIT-red.svg)](LICENSE)\n  [![npm](https://img.shields.io/npm/v/opencode-orchestrator.svg)](https://www.npmjs.com/package/opencode-orchestrator)\n  \u003c!-- VERSION:START --\u003e\n  **Version:** `1.3.1`\n  \u003c!-- VERSION:END --\u003e\n\u003c/div\u003e\n\n\n---\n\n## ⚡ Quick Start\n\n```bash\nnpm install -g opencode-orchestrator\n```\n\nInstall hooks are source-checkout safe, prefer `opencode.jsonc` when present, preserve sibling plugin entries, and skip automatic config mutation in CI environments.\n\nTo remove the plugin safely later, run:\n\n```bash\nnpm explore -g opencode-orchestrator -- npm run cleanup:plugin\nnpm uninstall -g opencode-orchestrator\n```\n\n`npm uninstall -g` does not run dependency uninstall hooks in the npm 11 flow verified for this repo, so config cleanup is explicit.\n\nInside an OpenCode environment:\n```bash\n/task \"Implement a new authentication module with JWT and audit logs\"\n```\n\n\n---\n\n## 🚀 Engine Workflow\n\n**Hub-and-Spoke Architecture** with Work-Stealing Queues for parallel, context-isolated task execution.\n```\n╔══════════════════════════════════════════════════════════════════════════════╗\n║                           USER INPUT /task \"...\"                              ║\n╚══════════════════════════════════════════════════════════════════════════════╝\n                                         │\n                                         ▼\n╔══════════════════════════════════════════════════════════════════════════════╗\n║  ┌─────────────────────────────────────────────────────────────────────────┐ ║\n║  │                            C O M M A N D E R                           │ ║\n║  │                    [ Mission Analysis \u0026 Delegation ]                    │ ║\n║  │                                                                          │ ║\n║  │    • Interprets user intent    • Coordinates multi-agent workflow      │ ║\n║  │    • Monitors progress          • Manages work-stealing queues         │ ║\n║  └─────────────────────────────────────────────────────────────────────────┘ ║\n╚══════════════════════════════════════════════════════════════════════════════╝\n                                         │\n                         ┌───────────────┼───────────────┐\n                         ▼               ▼               ▼\n╔═════════════════╗  ╔═════════════════╗  ╔═════════════════╗\n║   P L A N N E R ║  ║     W O R K E R ║  ║    W O R K E R   ║\n║  [Architect]    ║  ║  [Implementer]  ║  ║  [Implementer]   ║\n║                 ║  ║                 ║  ║                 ║\n║  • Dependency   ║  ║  • File coding ║  ║  • File coding  ║\n║    analysis     ║  ║  • TDD workflow ║  ║  • TDD workflow ║\n║  • Roadmap gen ║  ║  • Documentation║  ║  • Documentation║\n║  • TODO.md      ║  ║                 ║  ║                 ║\n╚═════════════════╝  ╚═════════════════╝  ╚═════════════════╝\n         │                   │                     │\n         │    ┌──────────────┼─────────────────────┘\n         │    │              │\n         ▼    ▼              ▼\n╔══════════════════════════════════════╗\n║         SESSION POOL (MVCC Sync)   ║\n║   ┌─────────────────────────────────┐ ║\n║   │  Object Pool │ Buffer Pool      │ ║\n║   │  String Pool │ Connection Pool  │ ║\n║   └─────────────────────────────────┘ ║\n╚══════════════════════════════════════╝\n         │\n         ▼\n╔══════════════════════════════════════╗\n║       MSVP MONITOR / REVIEWER       ║\n║  ┌─────────────────────────────────┐ ║\n║  │  • Adaptive polling (500ms-5s) │ ║\n║  │  • Stability detection         │ ║\n║  │  • Unit test verification      │ ║\n║  └─────────────────────────────────┘ ║\n╚══════════════════════════════════════╝\n                 │\n                 ▼\n        ┌────────────────┐\n        │  ✨ COMPLETED  │\n        └────────────────┘\n```\n\n---\n\n## 🏗️ Architecture Layers\n\n```\n┌─────────────────────────────────────────────────────────────────────────────┐\n│                           PRESENTATION LAYER                                │\n│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐  ┌─────────────────┐  │\n│  │ Task Toast  │  │ Progress    │  │ Notification│  │ Mission Summary │  │\n│  │ Manager     │  │ Notifier    │  │ Manager     │  │ Display         │  │\n│  └─────────────┘  └─────────────┘  └─────────────┘  └─────────────────┘  │\n├─────────────────────────────────────────────────────────────────────────────┤\n│                           BUSINESS LOGIC LAYER                              │\n│  ┌───────────────────────────────────────────────────────────────────────┐  │\n│  │                    Parallel Agent Orchestration                        │  │\n│  │  ┌────────────┐  ┌────────────┐  ┌────────────┐  ┌────────────────┐  │  │\n│  │  │ Commander  │  │  Planner   │  │  Worker    │  │   Reviewer     │  │  │\n│  │  │   Agent    │  │   Agent    │  │   Agent    │  │     Agent      │  │  │\n│  │  └────────────┘  └────────────┘  └────────────┘  └────────────────┘  │  │\n│  └───────────────────────────────────────────────────────────────────────┘  │\n│  ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────────────────┐│\n│  │ Concurrency     │  │   Task Store   │  │    Hook System              ││\n│  │ Controller      │  │   (In-Memory)  │  │  [Early/Normal/Late Phases] ││\n│  └─────────────────┘  └─────────────────┘  └─────────────────────────────┘│\n├─────────────────────────────────────────────────────────────────────────────┤\n│                           INFRASTRUCTURE LAYER                              │\n│  ┌────────────────┐  ┌────────────────┐  ┌────────────────────────────┐  │\n│  │ Session Pool   │  │ Work-Stealing  │  │    Memory Pools           │  │\n│  │ [5 per agent]  │  │ [Chase-Lev]    │  │  ┌──────┐ ┌──────┐ ┌─────┐│  │\n│  │ [10 reuse max] │  │ [LIFO/FIFO]    │  │  │Object│ │String│ │Buffer││  │\n│  └────────────────┘  └────────────────┘  │  │ 200  │ │ intern│ │ 4KB ││  │\n│                                          │  └──────┘ └──────┘ └─────┘│  │\n│  ┌────────────────┐  ┌────────────────┐  └────────────────────────────┘  │\n│  │ MVCC State     │  │ Circuit Breaker │  ┌────────────────────────────┐  │\n│  │ [Atomic Sync]  │  │ [5 failures→open│  │ Rust Connection Pool     │  │\n│  │                │  │  [2 success→close│ │ [4 processes, 30s idle]   │  │\n│  └────────────────┘  └────────────────┘  └────────────────────────────┘  │\n├─────────────────────────────────────────────────────────────────────────────┤\n│                           SAFETY LAYER                                      │\n│  ┌────────────────┐  ┌────────────────┐  ┌─────────────────────────────┐ │\n│  │ RAII Pattern   │  │ Shutdown       │  │ Auto-Recovery               │ │\n│  │ [Zero Leaks]   │  │ Manager        │  │ [Exponential Backoff]       │ │\n│  │                │  │ [5s timeout]   │  │ [Rate limit handling]       │ │\n│  └────────────────┘  └────────────────┘  └─────────────────────────────┘ │\n└─────────────────────────────────────────────────────────────────────────────┘\n```\n\n---\n\n## 🧪 Test Utilities\n\nReusable test helpers keep filesystem, task, and process-heavy flows deterministic:\n\n```\ntests/harness/\n├── fixture.ts          Disposable tmpdir utilities\n│   ├── tmpdir()        async disposable with cleanup\n│   ├── tmpdirSync()    sync disposable with cleanup  \n│   ├── createMockFs()  In-memory fs mock\n│   └── waitFor()       Async condition waiter\n│\n├── builders.ts         Factory functions for test objects\n│   ├── createParallelTask()    Build ParallelTask instances\n│   ├── createBackgroundTask()  Build BackgroundTask instances\n│   └── createTodo()            Build Todo instances\n│\n├── mocks.ts           Mock utilities\n│   ├── mockConsole()         Spy on console.log/error\n│   ├── mockProcessExit()     Mock process.exit\n│   ├── useFakeTimers()       Time manipulation\n│   └── createMockEmitter()   EventEmitter spy\n│\n└── index.ts           Unified exports\n```\n\n### Usage Example\n\n```typescript\nimport { tmpdir, createParallelTask, mockConsole } from \"@/tests/harness\";\n\ndescribe(\"My test\", () =\u003e {\n  let consoleMock;\n\n  beforeEach(() =\u003e {\n    consoleMock = mockConsole();\n    consoleMock.setup();\n  });\n\n  afterEach(() =\u003e {\n    consoleMock.restore();\n  });\n\n  it(\"should work\", async () =\u003e {\n    await using tmp = await tmpdir({ git: true });\n    const task = createParallelTask({ description: \"Test\" });\n    expect(task.status).toBe(\"pending\");\n  });\n});\n```\n\n---\n\n## ⚡ Elite Multi-Agent Swarm\n\n| Agent | Role | Core Responsibilities |\n|:------|:-----|:------------------------|\n| **Commander** | Mission Hub | Task decomposition, agent coordination, work-stealing orchestration, final mission seal |\n| **Planner** | Architect | Dependency analysis, roadmap generation, TODO.md creation via MVCC, file-level planning |\n| **Worker** | Implementer | High-throughput coding, TDD workflow, documentation, isolated file execution |\n| **Reviewer** | Auditor | Unit test verification, LSP/Lint validation, integration testing, quality gate |\n---\n\n## 🛠️ Core Capabilities\n\n### 🔒 Atomic MVCC State Synchronization\nSolves the \"Concurrent TODO Update\" problem using **MVCC + Mutex**. Agents safely mark tasks complete in parallel without data loss or race conditions. Every state change is cryptographically hashed and logged.\n\n### 🧩 Advanced Hook Orchestration\nExecution flows governed by a **Priority-Phase Hook Registry**. Hooks are grouped into phases (`early`, `normal`, `late`) and executed via **Topological Sort** for predictable, dependency-aware ordering.\n\n### 🛡️ Autonomous Recovery\n- **Self-healing loops** with adaptive stagnation detection\n- **Proactive Agency**: Smart monitoring that audits logs and plans ahead during background tasks\n- **Auto-retry with backoff**: Exponential backoff for transient failures\n\n### 🎯 State-Level Session Isolation\nReused sessions in the **SessionPool** are explicitly reset via server-side compaction, ensuring previous task context never leaks into new tasks.\n\n### 🚀 Zero-Payload Turbo Mode\nLeverages `system.transform` to unshift agent instruction sets server-side, reducing initial message payloads by **90%+** and preventing context fragmentation.\n\n### 🧠 Hierarchical Memory System\nMaintains focus across thousands of conversation turns using a 4-tier memory structure with **EMA-based Context Gating** to preserve architectural truth while pruning noise.\n\n### 🔄 Adaptive Intelligence Loop\n- **Stagnation Detection**: Senses when no progress is made across iterations\n- **Diagnostic Intervention**: Forces \"Diagnostic Mode\" mandating log audits and strategy pivots\n- **Proactive Agency**: Mandates Speculative Planning during background task execution\n\n### 🧬 Knowledge Graph RAG (Second Brain)\nAn autonomous **Obsidian-style evolutionary memory system** that gives agents persistent, searchable knowledge across sessions.\n\n```\n  ┌──────────────┐     ┌──────────────┐     ┌──────────────┐\n  │  📝 Ingest   │────▶│  🔍 Search   │────▶│  🧠 Recall   │\n  │  ──────────  │     │  ──────────  │     │  ──────────  │\n  │  YAML Parser │     │  BM25 Lexical│     │  RRF-Ranked  │\n  │  Tag HashMap │     │  Tag Index   │     │  Top-K Notes │\n  │  Wiki-Links  │     │  2-Hop Graph │     │  → Context   │\n  └──────┬───────┘     └──────────────┘     └──────────────┘\n         │\n         ▼\n  ┌──────────────┐     ┌──────────────┐     ┌──────────────┐\n  │  🔄 Evolve   │────▶│  🛡️ Guard    │────▶│  📦 Archive  │\n  │  ──────────  │     │  ──────────  │     │  ──────────  │\n  │  Fission     │     │  Cycle DFS   │     │  Orphan GC   │\n  │  Fusion      │     │  Write FIFO  │     │  MOC Hubs    │\n  │  (Auto-Split │     │  Keep-Pin    │     │  MD Export   │\n  │   \u0026 Merge)   │     │  Shield      │     │              │\n  └──────────────┘     └──────────────┘     └──────────────┘\n```\n\n**Six integrated modules** power the knowledge pipeline:\n\n| Module | Purpose |\n|:-------|:--------|\n| **TagIndexer** | O(1) YAML frontmatter parsing → tag-to-file HashMap |\n| **GraphParser** | `[[wiki-link]]` extraction, bi-directional adjacency graph |\n| **HybridSearch** | BM25 + Tag + 2-Hop Graph → **Reciprocal Rank Fusion** (k=60) |\n| **Scratchpad** | LRU register cache (64 slots, 4KB max) with markdown persistence |\n| **SafetyGuards** | Circular link DFS, async FIFO write queue, keep-pin shield |\n| **MemoryConsolidation** | Fission/Fusion/GC/MOC — pure functional analysis |\n\n---\n\n## ⚙️ Performance Benchmarks\n\n| Metric | Improvement |\n|:-------|:------------|\n| CPU Utilization | 90%+ (up from 50-70%) |\n| Tool Call Speed | 10x faster (5-10ms vs 50-100ms) via Rust pool |\n| Session Creation | 90% faster (50ms vs 500ms) via session pooling |\n| Memory Usage | 60% reduction via object/string/buffer pooling |\n| GC Pressure | 80% reduction |\n| Token Efficiency | 40% reduction via Incremental State \u0026 System Transform |\n| Sync Accuracy | 99.95% via MVCC+Mutex |\n| Parallel Efficiency | 80% improvement (50% → 90%+) |\n\n---\n\n## 🏗️ Infrastructure \u0026 Reliability\n\n### Resource Safety\n- **RAII Pattern**: Guaranteed resource cleanup with zero leaks\n- **ShutdownManager**: Priority-based graceful shutdown (5s timeout per handler)\n- **Atomic File Operations**: Temp file + rename for corruption-proof writes\n- **Automatic Backups**: Timestamped config backups with rollback support\n\n### Safety Features\n- **Circuit Breaker**: Auto-recovery from API failures (5 failures → open)\n- **Resource Pressure Detection**: Rejects low-priority tasks when memory \u003e 80%\n- **Terminal Node Guard**: Prevents infinite recursion via depth limit\n- **Auto-Scaling**: Concurrency slots adjust based on success/failure rate\n\n### Technical Stack\n- **Runtime**: Node.js 18+ (TypeScript)\n- **Tools**: Rust-based CLI tools (grep, glob, ast) via connection pool\n- **Concurrency**: Chase-Lev work-stealing deque + priority queues\n- **Memory**: Object pooling + string interning + buffer pooling\n- **State Management**: MVCC + Mutex\n- **Safety**: RAII + circuit breaker + resource pressure detection\n- **Knowledge**: In-memory graph RAG with BM25/Tag/Graph search fusion\n\n---\n\n## 🔧 Installation \u0026 Configuration\n\n### Safe Installation\nThe installation process is **production-safe** with multiple protection layers:\n\n1. ✅ **Never overwrites** — always merges with existing config\n2. ✅ **Automatic backups** — timestamped, last 5 kept\n3. ✅ **Atomic writes** — temp file + rename (OS-level atomic)\n4. ✅ **Automatic rollback** — restores from backup on any failure\n5. ✅ **Cross-platform** — Windows (native, Git Bash, WSL2), macOS, Linux\n6. ✅ **CI-aware** — skips non-essential operations in CI environments\n7. ✅ **Timeout protection** — 30s timeout prevents hanging\n8. ✅ **Graceful degradation** — exits 0 on non-critical failures\n\n### Safe Removal\nOpenCode config cleanup is provided as an explicit command because global package uninstall does not invoke dependency uninstall hooks in the npm flow validated for this package.\n\n```bash\nnpm explore -g opencode-orchestrator -- npm run cleanup:plugin\nnpm uninstall -g opencode-orchestrator\n```\n\nManual fallback:\n- Open `~/.config/opencode/opencode.json` or `opencode.jsonc`\n- Remove `\"opencode-orchestrator\"` from the `plugin` array\n\n### Configuration Logs\n- Unix: `/tmp/opencode-orchestrator.log`\n- Windows: `%TEMP%\\opencode-orchestrator.log`\n\n---\n\n## 🧪 Testing \u0026 Stability\n\n### Test Utilities\nReusable helpers under `tests/harness/` provide:\n- **Disposable tmpdir**: Automatic cleanup with `Symbol.asyncDispose` / `Symbol.dispose`\n- **Test builders**: Factory functions for `ParallelTask`, `BackgroundTask`, `Todo`\n- **Mock utilities**: Console, process, timers, file system, event emitter mocks\n\n```typescript\nimport { tmpdir, createParallelTask, mockConsole } from \"@/tests/harness\";\n\nawait using tmp = await tmpdir({ git: true });\nconst task = createParallelTask({ description: \"Test\" });\n```\n\n### TUI Stability\n- **Cleanup guarantees**: `initToastClient()` returns a cleanup function\n- **Timeout protection**: AbortController-based 2-10s timeout for async toast operations\n- **Error isolation**: Try/catch around all toast operations prevents cascade failures\n\n### Cross-Platform Reliability\n- **Windows guard**: Proper handling of WSL2, Git Bash, native Windows paths\n- **Signal handling**: Graceful shutdown on SIGINT/SIGTERM\n- **Process isolation**: Child process cleanup with timeout\n\n---\n\n## 📚 Documentation\n\n- [System Architecture Deep-Dive →](docs/SYSTEM_ARCHITECTURE.md)\n- [Developer Notes →](docs/DEVELOPERS_NOTE.md)\n- [Knowledge RAG Roadmap →](docs/histories/2026/05/31/PLAN_SecondBrainOrchestration_2026-05-31.md)\n\n---\n\n## 📄 License\n\nMIT License — see [LICENSE](LICENSE) for details.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003csub\u003eBuilt with ⚡ for production-grade autonomous software engineering\u003c/sub\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagnusdei1207%2Fopencode-orchestrator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagnusdei1207%2Fopencode-orchestrator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagnusdei1207%2Fopencode-orchestrator/lists"}