| name | a2a-test |
| description | Systematically test the @agent-worker/loop and @agent-worker/agent packages against real LLM backends using the aw CLI. A2A tests are interactive, CLI-driven tests โ not automated TS scripts. Use this skill when the user asks to test loops, run a2a tests, verify runtime implementations, or check if agent loops work correctly. Trigger on phrases like 'test loops', 'run a2a tests', 'test the runtimes', 'verify loop implementations', 'check if claude/codex/cursor works'. |
A2A Test Skill
A2A (Agent-to-Agent) tests verify real runtime behavior against live LLM backends. They are interactive CLI tests using the aw CLI tool โ not automated TS scripts.
Test plans
All a2a test procedures are documented as markdown:
packages/loop/test/a2a/loop-tests.md โ Loop-level tests per runtime (AiSdkLoop, ClaudeCodeLoop, CodexLoop, CursorLoop)
packages/agent/test/a2a/agent-tests.md โ Agent-level end-to-end tests across all providers
packages/agent/test/a2a/messaging.md โ Async messaging pipeline tests (batching, interleaving, state transitions)
How to run
A2A tests are run manually using the unified aw CLI (packages/agent-worker/src/cli/index.ts):
aw add test-agent --runtime ai-sdk --model anthropic:claude-haiku-4-5-20251001
aw add test-agent --runtime claude-code --model sonnet
aw add test-agent --runtime codex
aw add test-agent --runtime cursor
aw add test-agent --runtime mock
aw send test-agent "Reply with exactly: HELLO_A2A_TEST"
aw read test-agent
aw log --json
aw state test-agent
aw rm test-agent
aw daemon stop
Test flow
For each runtime, verify in order:
- Preflight โ Agent added successfully (
aw add, daemon auto-starts)
- Simple prompt โ Send a trivial prompt, verify text response contains marker
- Event structure โ
aw log --json entries have correct type/shape
- Result structure โ
run_end has durationMs > 0, usage tracking (where supported)
- Status transitions โ
aw log -f shows idle โ processing โ idle
- Cancel โ
aw rm during processing terminates cleanly
- Tool calls โ
tool_call_start/tool_call_end pairing (where supported)
Unit tests (separate from a2a)
Unit tests are mock-based and run with bun test:
bun test packages/loop/test/
bun test packages/agent/test/
Loop APIs under test
Each loop class exposes:
preflight() โ PreflightResult โ env/config check
run(prompt) โ LoopRun โ streaming LoopEvent + .result: Promise<LoopResult>
cancel() โ abort in-flight run
status โ "idle" | "running" | "completed" | "failed" | "cancelled"
Event types
text โ text output
thinking โ reasoning/chain-of-thought
tool_call_start โ tool invocation begins (name, callId, args)
tool_call_end โ tool invocation completes (name, callId, result, durationMs, error)
error โ error occurred
unknown โ unrecognized event from provider
Runtime capability matrix
| Capability | AiSdkLoop | ClaudeCodeLoop | CodexLoop | CursorLoop |
|---|
| tool_call_end | Yes | Yes | Yes | No |
| callId in events | Yes | Yes | No | Yes |
| thinking events | Yes | No | No | No |
| usage tracking | Yes | Yes | No | No |
Verdicts
When running a2a tests, record results as pass/fail/skip in the test matrix at the bottom of each markdown file.