Priority: MEDIUM (Best practices)
Timeout: 90-180s
Must Pass: SHOULD (not absolute, but important)
Tests for delegation rules from openagent.md (lines 252-295):
Tests the 4+ files delegation rule.
Positive tests:
Negative tests:
Override tests:
Timeout: 90s (delegation involves subagent coordination)
Example test:
id: delegation-scale-4-files
prompt: |
Create a new feature that adds user authentication.
This will require changes to:
- src/auth/login.ts
- src/auth/register.ts
- src/auth/middleware.ts
- src/models/user.ts
behavior:
mustUseTools: [task] # Should delegate
requiresApproval: true
expectedViolations:
- rule: delegation
shouldViolate: false # Should delegate, not violate
Tests delegation for specialized knowledge tasks.
Examples of specialized knowledge:
Positive tests:
Timeout: 90s
Tests delegation for multi-step dependencies.
Positive tests:
Timeout: 90s
Tests delegation for multi-component review tasks.
Positive tests:
Timeout: 90s
Tests context bundle creation and passing to subagents.
What to verify:
.tmp/context/{session-id}/bundle.mdPositive tests:
Timeout: 120s (needs time for bundle creation + delegation)
Example test:
id: delegation-context-bundle-creation
prompt: |
Create a new feature with 5 files (triggers delegation).
Verify context bundle is created.
behavior:
mustUseTools: [read, task] # Read context, then delegate
requiresApproval: true
# After test, verify bundle exists
postConditions:
- fileExists: ".tmp/context/*/bundle.md"
- fileContains:
path: ".tmp/context/*/bundle.md"
text: "Task description"
Tests should verify agent creates files in correct locations:
# Agent should create context bundles here:
.tmp/context/{session-id}/bundle.md
# Test files should go here:
evals/test_tmp/
# Run all delegation tests
npm run eval:sdk -- --agent=openagent --pattern="03-delegation/**/*.yaml"
# Run specific category
npm run eval:sdk -- --agent=openagent --pattern="03-delegation/scale/*.yaml"
npm run eval:sdk -- --agent=openagent --pattern="03-delegation/context-bundles/*.yaml"
These tests validate best practices, not absolute requirements:
Failures here indicate suboptimal behavior, not critical errors.