Purpose: Understand the two ways to test subagents (standalone vs delegation)
Last Updated: 2026-01-07
Subagents have two distinct testing modes depending on what you're validating:
The mode determines which agent runs and how tools are used.
Purpose: Test subagent's logic in isolation
Command:
npm run eval:sdk -- --subagent=ContextScout
What Happens:
mode: primary (overrides mode: subagent)Use For:
Test Location: evals/agents/subagents/core/{subagent}/tests/standalone/
Purpose: Test real production workflow (parent delegates to subagent)
Command:
npm run eval:sdk -- --agent=core/openagent --pattern="delegation/*.yaml"
What Happens:
task tool to delegate to ContextScoutmode: subagent (natural mode)Use For:
Test Location: evals/agents/subagents/core/{subagent}/tests/delegation/
| Aspect | Standalone Mode | Delegation Mode |
|---|---|---|
| Flag | --subagent=NAME |
--agent=PARENT |
| Agent Mode | Forced to primary |
Natural subagent |
| Who Runs | Subagent directly | Parent → Subagent |
| Tool Usage | Subagent uses tools | Parent uses task tool |
| Tests | standalone/*.yaml |
delegation/*.yaml |
Common Mistake:
# ❌ WRONG - This runs OpenAgent, not ContextScout
npm run eval:sdk -- --agent=ContextScout
# ✅ CORRECT - This runs ContextScout directly
npm run eval:sdk -- --subagent=ContextScout
⚡ Standalone Test Mode
Subagent: contextscout
Mode: Forced to 'primary' for direct testing
Testing agent: core/openagent
🎯 PARENT: OpenAgent
Delegating to: contextscout
Use Standalone When:
Use Delegation When:
guides/testing-subagents.md - Step-by-step testing guidelookup/subagent-test-commands.md - Quick command referenceerrors/tool-permission-errors.md - Common testing issuesReference: evals/framework/src/sdk/run-sdk-tests.ts (mode forcing logic)