open-multi-agent/tests
JackChen 9f5afb10f5
feat(orchestrator): add onApproval callback for human-in-the-loop (#32)
* feat(orchestrator): add onApproval callback for human-in-the-loop (#32)

Add an optional `onApproval` callback to OrchestratorConfig that gates
between task execution rounds. After each batch of parallel tasks
completes, the callback receives the completed tasks and the tasks about
to start, returning true to continue or false to abort gracefully.

Key changes:
- Add 'skipped' to TaskStatus for user-initiated abort (distinct from 'failed')
- Add skip(), skipRemaining(), cascadeSkip() to TaskQueue
- Add 'task_skipped' to OrchestratorEvent for progress monitoring
- Approval gate in executeQueue() with try/catch for callback errors
- Synthesis prompt now includes skipped tasks section
- 17 new tests covering queue skip operations and orchestrator integration

Closes #32

* docs: clarify onApproval contract and add missing test scenarios

- Document skip() cascade semantics, skipRemaining() in-flight constraint,
  and onApproval trigger conditions / mutation warning
- Add concurrency safety comment on completedThisRound
- Note task_skipped as breaking union addition on OrchestratorEvent
- Add 3 test scenarios: single-batch no-callback, mixed success/failure
  batch, and onProgress task_skipped event relay
2026-04-05 02:46:20 +08:00
..
agent-hooks.test.ts feat(agent): add beforeRun / afterRun lifecycle hooks (#45) 2026-04-05 00:41:21 +08:00
approval.test.ts feat(orchestrator): add onApproval callback for human-in-the-loop (#32) 2026-04-05 02:46:20 +08:00
grok-adapter.test.ts feat(llm): add first-class Grok (xAI) support with dedicated GrokAdapter (#44) 2026-04-04 18:20:55 +08:00
semaphore.test.ts chore: add tests, CI, contributing guide, and PR template 2026-04-02 23:43:54 +08:00
shared-memory.test.ts chore: add tests, CI, contributing guide, and PR template 2026-04-02 23:43:54 +08:00
structured-output.test.ts feat: add optional outputSchema (Zod) for structured agent output (#36) 2026-04-03 13:45:47 +08:00
task-queue.test.ts chore: add tests, CI, contributing guide, and PR template 2026-04-02 23:43:54 +08:00
task-retry.test.ts feat: task-level retry with exponential backoff (#37) 2026-04-03 14:08:36 +08:00
task-utils.test.ts chore: add tests, CI, contributing guide, and PR template 2026-04-02 23:43:54 +08:00
tool-executor.test.ts chore: add tests, CI, contributing guide, and PR template 2026-04-02 23:43:54 +08:00
trace.test.ts feat: add onTrace observability callback (#18) 2026-04-03 15:28:59 +08:00