description: "Guide for testing subagents and handling approval gates" type: "context" category: "openagents-repo"
Context: openagents-repo/guides | Priority: HIGH | Updated: 2026-01-09
IMPORTANT: When writing tests for subagents, DO NOT include expectedViolations for approval-gate.
Subagents are delegated to by parent agents (OpenAgent, OpenCoder, etc.). The parent agent already requested and received approval before delegating. Therefore:
Correct (no approval gate expectations):
category: developer
agent: ContextScout
approvalStrategy:
type: auto-approve
behavior:
mustUseTools:
- read
- glob
forbiddenTools:
- write
- edit
minToolCalls: 2
maxToolCalls: 15
# NO expectedViolations for approval-gate!
Incorrect (don't do this):
expectedViolations:
- rule: approval-gate # ❌ WRONG for subagents
shouldViolate: false
severity: error
Test approval gates for:
Don't test approval gates for:
mode: subagent in frontmatterAlways use auto-approve for subagent tests:
approvalStrategy:
type: auto-approve
This simulates the parent agent having already approved the delegation.
id: contextscout-code-standards
name: "ContextScout: Code Standards Discovery"
description: Tests that ContextScout discovers code-related context files
category: developer
agent: ContextScout
prompts:
- text: |
Search for context files related to: coding standards
Task type: code
Return:
- Exact file paths
- Priority order
- Key findings
approvalStrategy:
type: auto-approve
behavior:
mustUseTools:
- read
- glob
forbiddenTools:
- write
- edit
minToolCalls: 2
maxToolCalls: 15
timeout: 60000
tags:
- contextscout
- discovery
- subagent
.opencode/context/openagents-repo/guides/testing-subagents.md.opencode/context/openagents-repo/guides/subagent-invocation.md.opencode/context/openagents-repo/core-concepts/agents.mdLast Updated: 2026-01-09
Version: 1.0.0