* feat(evals): restructure OpenAgent tests + fix SDK mode session creation
## Test Restructure
Reorganize OpenAgent tests into 6 priority-based categories for better
maintainability, scalability, and CI/CD integration.
New structure:
- 01-critical-rules/ (15 tests) - MUST PASS safety requirements
- 02-workflow-stages/ (2 tests) - Workflow validation
- 03-delegation/ (0 tests) - Delegation scenarios (ready for new tests)
- 04-execution-paths/ (2 tests) - Conversational vs task paths
- 05-edge-cases/ (1 test) - Edge cases and boundaries
- 06-integration/ (2 tests) - Complex multi-turn scenarios
Changes:
- Migrate 22 existing tests to new structure (verified identical)
- Add comprehensive documentation (5 markdown files)
- Add migration and verification scripts
- Preserve original test locations for backward compatibility
## Bug Fix: SDK Mode Session Creation
Fix session creation failure introduced in commit
|
||
|---|---|---|
| .. | ||
| medium | ||
| README.md | ||
Integration Tests
Priority: LOW (Complex scenarios)
Timeout: 120-300s
Must Pass: NICE TO HAVE (validates real-world usage)
Purpose
Complex multi-turn scenarios that test multiple features working together:
- Multiple workflow stages
- Context loading + delegation
- Error handling + recovery
- Multi-agent coordination
Subfolders
simple/ (1-2 turns, single context)
Simple multi-turn conversations with minimal complexity.
Characteristics:
- 1-2 user messages
- Single context file
- Single workflow path
- No delegation
Timeout: 120s
Example:
prompts:
- text: "What are our coding standards?"
- text: "Create a function following those standards"
medium/ (3-5 turns, multiple contexts)
Medium complexity with multiple contexts and workflows.
Characteristics:
- 3-5 user messages
- Multiple context files
- May involve delegation
- Multiple workflow stages
Timeout: 180s
Example:
prompts:
- text: "What are our coding standards?"
- text: "What are our documentation standards?"
- text: "Create a function with documentation"
- text: "approve"
complex/ (6+ turns, delegation + validation)
Complex scenarios with full workflow validation.
Characteristics:
- 6+ user messages
- Multiple context files
- Delegation required
- Full workflow: Analyze→Approve→Execute→Validate→Summarize→Confirm
- Error handling and recovery
Timeout: 300s (5 minutes)
Example:
prompts:
- text: "Create authentication system (5 files)"
- text: "approve delegation"
- text: "Run tests"
- text: "approve test run"
# Test fails
- text: "Fix the errors"
- text: "approve fix"
- text: "Run tests again"
- text: "approve"
File Creation Rules
All file operations use safe paths:
# ✅ CORRECT
evals/test_tmp/
.tmp/sessions/{session-id}/
.tmp/context/{session-id}/
# ❌ WRONG
/tmp/
~/
Running These Tests
# Run all integration tests (SLOW - 15-30 min)
npm run eval:sdk -- --agent=openagent --pattern="06-integration/**/*.yaml"
# Run by complexity
npm run eval:sdk -- --agent=openagent --pattern="06-integration/simple/*.yaml"
npm run eval:sdk -- --agent=openagent --pattern="06-integration/medium/*.yaml"
npm run eval:sdk -- --agent=openagent --pattern="06-integration/complex/*.yaml"
Success Criteria
These tests validate real-world usage patterns:
- SHOULD pass for production readiness
- MAY fail during development
- MUST pass before major releases
Failures here indicate issues with complex workflows, not basic functionality.
Test Design Guidelines
Simple Tests
- Focus on single feature
- Minimal user interaction
- Clear success criteria
Medium Tests
- Test feature combinations
- Multiple contexts
- Realistic workflows
Complex Tests
- Full end-to-end scenarios
- Error handling
- Recovery workflows
- Multi-agent coordination
Debugging
For complex tests that fail:
-
Run with --debug flag:
npm run eval:sdk -- --agent=openagent --pattern="06-integration/complex/01-*.yaml" --debug -
Check session files (preserved in debug mode):
ls ~/.local/share/opencode/storage/session/ -
Review event timeline:
- Look for missing stages
- Check tool call sequence
- Verify context loading
-
Simplify the test:
- Remove turns to isolate issue
- Test individual stages separately
- Move to simpler category if needed