위임과 Kanban
기준일: 2026-07-26
난이도: 고급
공식 기준: Delegation, Kanban Multi-Agent
큰 작업은 한 에이전트가 모든 컨텍스트를 오래 들기보다, 독립 가능한 하위 작업으로 나누는 편이 낫습니다. Hermes에는 단기 RPC형 delegate_task와 내구 작업 큐 Kanban이 있습니다.
핵심 개념
| 기능 | 설명 |
|---|---|
delegate_task |
격리 컨텍스트 child AIAgent; 최종 요약만 부모에 합류 |
| isolated context | child는 부모 히스토리를 모름 — goal+context에 전부 넣기 |
| Kanban | ~/.hermes/kanban.db 기반 보드; 프로필·재시작·사람 개입 가능 |
| handoff | kanban_complete summary/metadata 또는 delegate 결과 요약 |
delegate_task vs Kanban
delegate_task |
Kanban | |
|---|---|---|
| 형태 | fork → join (RPC) | durable queue + 상태 머신 |
| 부모 | 결과 대기(오케스트레이터) / 상위는 백그라운드 핸들 | create 후 fire-and-forget |
| 정체성 | 익명 subagent | named profile + memory |
| 재개 | 실패=실패 | block → unblock → re-run |
| 사람 | 불가 | comment / unblock |
한 줄: delegate_task는 함수 호출, Kanban은 핸드오프가 남는 작업 큐.
선택 기준
- 부모가 즉시 요약이 필요, 사람 개입 없음 →
delegate_task - 재시작·역할 교체·며칠 단위·감사 로그 → Kanban
- 같은 파일을 여러 구현 에이전트가 동시에 건드리지 말 것
- 오케스트레이터는 분해·할당, 구현은 worker 프로필
실습
delegate_task
단일:
delegate_task(
goal="Fix the TypeError in api/handlers.py",
context="""TypeError on line 47: NoneType has no attribute get.
Project at /home/user/myproject, Python 3.11.
Run pytest tests/auth/ after the fix.""",
max_iterations=10,
)
병렬 배치(기본 동시 3, delegation.max_concurrent_children으로 변경, 상한 없음·초과 시 에러):
delegate_task(tasks=[
{"goal": "Research topic A", "context": "Focus on primary sources"},
{"goal": "Research topic B", "context": "Compare leading explanations"},
{"goal": "Fix the build", "context": "Project root: /home/user/project"},
])
중첩 오케스트레이션(기본 max_spawn_depth: 1 = flat; orchestrator 자식을 쓰려면 depth 상향):
delegate_task(
goal="Survey three approaches and recommend one",
role="orchestrator",
context="...",
)
# ~/.hermes/config.yaml
delegation:
max_iterations: 50
# max_concurrent_children: 3
# max_spawn_depth: 1
# orchestrator_enabled: true
# child_timeout_seconds: 0 # 0 = no wall clock timeout
# model: "google/gemini-flash-2.0"
# provider: "openrouter"
모니터링: TUI /agents (alias /tasks). 라이브 로그: ~/.hermes/cache/delegation/live/<delegation_id>/task-<n>.log (tail -f). Leaf child는 보통 delegation·clarify·memory 등이 차단; execute_code는 유지될 수 있음(공식 문서 Key Properties).
Kanban — 사람/CLI
hermes kanban init
hermes gateway start
hermes kanban create "research AI funding landscape" --assignee researcher
hermes kanban list
hermes kanban stats
hermes kanban watch
hermes kanban create "nightly ops review" \
--assignee ops \
--idempotency-key "nightly-ops-$(date -u +%Y-%m-%d)"
hermes kanban complete t_abc --result "done"
hermes kanban block t_abc "need product input"
hermes kanban unblock t_abc
보드(멀티 프로젝트):
hermes kanban boards list
hermes kanban boards create atm10-server --name "ATM10 Server" --switch
hermes kanban --board atm10-server list
Goal-mode 카드:
hermes kanban create "Translate the docs site to French" \
--body "Acceptance: every page translated, links intact." \
--assignee linguist \
--goal \
--goal-max-turns 15
대시보드: hermes dashboard → Kanban 탭.
Kanban — worker 도구 (모델)
Dispatcher가 HERMES_KANBAN_TASK를 심으면 kanban_* 도구가 스키마에 올라갑니다. CLI를 셸로 치지 않습니다.
| 도구 | 용도 |
|---|---|
kanban_show |
현재 task·worker_context |
kanban_list |
필터 목록 (오케스트레이터) |
kanban_complete |
summary / metadata 로 완료 |
kanban_block |
reason·kind |
kanban_heartbeat |
장시간 생존 신호 |
kanban_comment |
스레드 메모 |
kanban_create / kanban_link / kanban_unblock |
오케스트레이터 라우팅 |
kanban_show()
# ... work in $HERMES_KANBAN_WORKSPACE ...
kanban_complete(
summary="migrated limiter.py; 14 tests pass",
metadata={"changed_files": ["limiter.py"], "verification": ["pytest -q"]},
)
Kanban 설정 키
kanban:
dispatch_in_gateway: true
dispatch_interval_seconds: 60
auto_decompose: true
auto_decompose_per_tick: 3
# orchestrator_profile: ""
# default_assignee: ""
workspace 종류: scratch(완료 시 삭제, artifacts 제외), dir:</abs/path>, worktree / worktree:<path>.
Hermes에 입력할 프롬프트
지금 작업을 delegate_task 단위와 Kanban 카드 단위로 나눠줘.
각 단위에 goal/context 또는 title/body, assignee 프로필, 검증 명령, 금지 파일 범위를 적어줘.
같은 파일을 병렬 수정하는 항목이 있으면 직렬화 이유를 설명해줘.
체크리스트
- 위임 단위가 독립적이고 검증 가능하다.
- child
context에 오류·경로·검증 명령을 넣었다. - Kanban worker가
kanban_complete/block으로 종료한다. - gateway dispatcher가 떠 있다 (
dispatch_in_gateway). - 장기 작업에 heartbeat·stale reclaim을 고려했다.