open-multi-agent/tests
EchoOfZion 9463dbb28e refactor(orchestrator): address PR #70 review feedback
Addresses all five review points from @JackChen-me on PR #70:

1. Extract shared keyword helpers into src/utils/keywords.ts so the
   short-circuit selector and Scheduler.capability-match cannot drift.
   Both orchestrator.ts and scheduler.ts now import the same module.

2. selectBestAgent now mirrors Scheduler.capability-match exactly,
   including the asymmetric use of agent.model: agentKeywords includes
   model, agentText does not. This restores parity with the documented
   capability-match behaviour.

3. Remove isSimpleGoal and selectBestAgent from the public barrel
   (src/index.ts). They remain exported from orchestrator.ts for unit
   tests but are no longer part of the package API surface.

4. Forward the AbortSignal from runTeam(options) through the
   short-circuit path. runAgent() now accepts an optional
   { abortSignal } argument; runTeam's short-circuit branch passes
   the caller's signal so cancellation works for simple goals too.

5. Tighten the collaborate/coordinate complexity regexes so they only
   fire on imperative directives ("collaborate with X", "coordinate
   the team") and not on descriptive uses ("explain how pods
   coordinate", "what is microservice collaboration").

Also fixes a pre-existing test failure in token-budget.test.ts:
"enforces orchestrator budget in runTeam" was using "Do work" as its
goal which now short-circuits, so the coordinator path the test was
exercising never ran. Switched to a multi-step goal.

Adds 60 new tests across short-circuit.test.ts and the new
keywords.test.ts covering all five fixes.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-07 21:46:03 +09:00
..
e2e test: add LLM adapter contract tests, improve coverage from 71% to 88% (#56) 2026-04-05 14:14:43 +08:00
helpers test: add LLM adapter contract tests, improve coverage from 71% to 88% (#56) 2026-04-05 14:14:43 +08:00
abort-signal.test.ts fix: correct Team constructor usage in abort-signal tests 2026-04-06 12:54:24 +08:00
agent-hooks.test.ts feat: implement token budget management in agent and orchestrator (#71) 2026-04-06 23:14:08 +08:00
agent-pool.test.ts fix: add per-agent mutex to prevent concurrent runs on same Agent instance (#72) 2026-04-07 03:42:24 +08:00
anthropic-adapter.test.ts test: add LLM adapter contract tests, improve coverage from 71% to 88% (#56) 2026-04-05 14:14:43 +08:00
approval.test.ts feat(orchestrator): add onApproval callback for human-in-the-loop (#32) 2026-04-05 02:46:20 +08:00
built-in-tools.test.ts test: improve coverage from 37% to 71% (#41) (#53) 2026-04-05 13:37:00 +08:00
copilot-adapter.test.ts test: add LLM adapter contract tests, improve coverage from 71% to 88% (#56) 2026-04-05 14:14:43 +08:00
gemini-adapter-contract.test.ts test: add LLM adapter contract tests, improve coverage from 71% to 88% (#56) 2026-04-05 14:14:43 +08:00
gemini-adapter.test.ts chore: support Node >=18, add optional @google/genai peer dependency and API key fallback 2026-04-04 22:12:28 +03: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
keywords.test.ts refactor(orchestrator): address PR #70 review feedback 2026-04-07 21:46:03 +09:00
llm-adapters.test.ts test: improve coverage from 37% to 71% (#41) (#53) 2026-04-05 13:37:00 +08:00
loop-detection.test.ts feat(agent): smart loop detection for stuck agents (#49) 2026-04-05 13:01:53 +08:00
openai-adapter.test.ts test: add LLM adapter contract tests, improve coverage from 71% to 88% (#56) 2026-04-05 14:14:43 +08:00
openai-fallback.test.ts feat(llm): add fallback tool-call extraction for local models (#15) 2026-04-05 11:49:10 +08:00
orchestrator.test.ts feat: skip coordinator for simple goals in runTeam() 2026-04-07 21:21:36 +09:00
scheduler.test.ts test: improve coverage from 37% to 71% (#41) (#53) 2026-04-05 13:37:00 +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
short-circuit.test.ts refactor(orchestrator): address PR #70 review feedback 2026-04-07 21:46:03 +09: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
team-messaging.test.ts test: improve coverage from 37% to 71% (#41) (#53) 2026-04-05 13:37:00 +08:00
text-tool-extractor.test.ts feat(llm): add fallback tool-call extraction for local models (#15) 2026-04-05 11:49:10 +08:00
token-budget.test.ts refactor(orchestrator): address PR #70 review feedback 2026-04-07 21:46:03 +09: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: implement token budget management in agent and orchestrator (#71) 2026-04-06 23:14:08 +08:00