minion-orchestrator
Skill này làm gì
Skill này quản lý các tác vụ nền tiếp tục chạy ngay cả khi phiên khởi động lại. Nó xử lý cả tác vụ shell đơn giản lẫn tác vụ do sub-agent AI thực hiện, và cho phép bạn kiểm tra tiến độ hoặc tạm dừng.
Khi nào nên dùng
- ✓Khi bạn muốn một tác vụ dài tiếp tục chạy nền ngay cả sau khi khởi động lại.
- ✓Khi bạn muốn chia một công việc lớn thành nhiều tác vụ song song và theo dõi chúng.
- ✓Khi bạn muốn tạm dừng, tiếp tục hoặc điều hướng một việc đang chạy.
Liên kết skill
https://github.com/garrytan/gbrain/blob/master/plugin/skills/minion-orchestrator/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Chạy việc dọn dẹp dữ liệu này như một tác vụ nền tồn tại sau khi khởi động lại, và để tôi kiểm tra tiến độ sau.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent gửi mỗi việc vào một hàng đợi bền vững lưu trong Postgres. Nó ghi lại tiến độ và mức dùng token, cho phép bạn gửi thông điệp điều hướng đến công việc đang chạy, và báo cáo khi kết quả được giao.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Minion Orchestrator
Contract
Minions is a Postgres-native job queue for durable, observable background work. This single skill handles two lanes:
- Deterministic shell jobs (
gbrain jobs submit shell ...) - LLM subagent jobs (
gbrain agent run ...)
When to route to Minions: durable, observable work that must survive restarts,
fan out across many parallel tasks, or persist across sessions. Routing policy
is defined in skills/conventions/subagent-routing.md — the project default is
pain_triggered (native subagents first, Minions after specific pain signals
fire); Mode A (all-through-Minions) is opt-in.
Guarantees:
- Jobs survive gateway restart (Postgres-backed)
- Every job has structured progress, token accounting, and session transcripts
- Running agents can be steered mid-flight via inbox messages
- Jobs can be paused, resumed, or cancelled at any time
- Parent-child DAGs with configurable failure policies
Durable-execution doctrine (routing convention the agent follows — nothing mechanically enforces it; see "Durable execution" below):
- Operations expected to exceed ~2 minutes route through the capability ladder, never a bare background shell that dies with the session.
- A deadman check verifies the result was REPORTED to the user, not merely that the process exited — a swallowed completion event looks identical to a dead job from the user's side.
- The deadman is second-line insurance, not a delivery guarantee: it can
itself die before firing (scheduler restart, deleted entry). Backstop:
on the next turn, sweep
gbrain jobs list --status activeand recent completions for overdue work whose result never reached the user. - Deadman checks are idempotent. A double-fire, or a fire that races the normal completion report, produces silence — it checks reported-state first and tags any recovery report with the job ID so duplicates are detectable.
- A checkpoint or progress file is trusted only with a freshness check.
A stale checkpoint reads as "still running" forever; compare its
timestamp against the expected progress interval and against
gbrain jobs get <id>.
Route the Request: Shell Job vs Subagent
| Condition | Action |
|---|---|
| User asks for deterministic command/script run | Shell job (CLI: gbrain jobs submit shell ...) |
| User asks to "run in minions" + explicit command/argv | Shell job (CLI, --params with cmd or argv) |
| User asks for research/reasoning/iterative agent | Subagent job (CLI: gbrain agent run) |
| User asks to steer/pause/resume an agent | Subagent job lifecycle tools (MCP-callable) |
| Single simple operation under ~30s | Consider inline execution first |
| Needs restart durability/observability | Submit as Minion job |
| Operation expected to exceed ~2 minutes | Route through the Durable execution ladder (below) |
| Parallel work (2+ streams) | gbrain agent run --fanout-manifest or parent + child subagents |
If intent is ambiguous, ask one clarification: "Do you want a deterministic shell command job, or an LLM agent job?"
Shell Jobs (Deterministic Scripts)
Use for reproducible command execution, ETL steps, cron work, and scriptable tasks where no LLM reasoning loop is needed.
Preconditions (read before submitting your first shell job)
- The worker must be started with
gbrain jobs work --allow-shell-jobs(equivalentlyGBRAIN_ALLOW_SHELL_JOBS=1exported on the worker; a.envin the worker's directory cannot set it). The shell handler is always registered but guarded: an unflagged worker that claims a shell job dead-letters it immediately (UnrecoverableError, straight todead, no retries) with the flag named inerror_text. A job that sits inwaitingmeans NO worker is running at all — checkgbrain jobs supervisor status. Gate lives insrc/core/minions/handlers/shell.ts. - Security: flipping
GBRAIN_ALLOW_SHELL_JOBS=1authorizes arbitrary command execution on the worker. On a shared queue, this is a remote code execution surface. Treat as privileged infrastructure authorization. - Execution mode — pick one:
- Postgres + daemon:
gbrain jobs workruns a persistent worker that claims and executes jobs from the queue. - PGLite + --follow:
gbrain jobs submit ... --followruns inline. The daemon mode is not available on PGLite (exclusive file lock). Seedocs/guides/minions-shell-jobs.md.
- Postgres + daemon:
- MCP boundary: shell-job submission is CLI-only. `submit_job n
Câu hỏi thường gặp
Các việc có tồn tại sau khi khởi động lại không?
Có. Hàng đợi được lưu trong Postgres, nên các việc tiếp tục sau khi cổng dịch vụ khởi động lại.
Tôi có thể thay đổi việc khi nó đang chạy không?
Có. Bạn có thể gửi thông điệp điều hướng, tạm dừng, tiếp tục hoặc hủy một việc.
Khi nào nên dùng sub-agent thông thường?
Quy tắc định tuyến ưu tiên sub-agent gốc trước và chỉ dùng hàng đợi khi gặp các vấn đề cụ thể.
Chi tiết
Mô tả gốc của tác giả
Unified Minions skill for both deterministic shell jobs and LLM subagent orchestration. Replaces the older `gbrain-jobs` routing intent. Use when: submitting gbrain jobs, shell/background tasks, spawning subagents, checking progress, steering running work, pausing/resuming, parallel fan-out. One durable, observable, steerable queue interface. Also carries the durable-execution doctrine for any operation expected to exceed ~2 minutes: capability ladder, deadman checks that verify the result was reported, and content-addressed stage checkpoints for expensive pipelines.
repo: garrytan/gbrain
Độ phổ biến
- Sao GitHub
- 31k
- Vị trí xếp hạng
- #9306
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
gbrain
31kCho phép agent của bạn tìm trong kho tri thức dùng chung của công ty các thông tin về con người, dự án và quyết định, và lưu ghi chú bền vững vào đó.
brain-ingest-gate
31kKiểm tra nội dung mới với kho tri thức hiện có trước khi thêm vào, để tránh trùng lặp và xác định các thực thể được nêu tên trước.
brain-link-discipline
31kĐảm bảo agent của bạn kèm một liên kết hoạt động đến mỗi trang kho tri thức mà nó báo cáo, trong cùng một tin nhắn, để bạn mở được ngay.
brain-ops
31kCung cấp cho agent của bạn thói quen cốt lõi cho kho tri thức: kiểm tra ngữ cảnh có sẵn trước, lưu ghi chú rõ ràng kèm nguồn và liên kết các trang liên quan.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.