Problem
Users have no supported way to unit-test agents without hitting a real LLM:
- A mock provider exists (
ProviderTypeMock, internal/llm/factory.go:26,477-484; internal/llm/mock_adapter.go) and is technically reachable via provider = "mock", but it is undocumented, internal-flavored, and not scriptable (fixed responses only).
- No fake memory, fake tool, or stream-assertion helpers are exported. The repo's own tests live in
test/ and internal/ and aren't reusable by consumers.
- Frameworks users will compare against (Genkit, LangChainGo) ship test helpers; for a framework whose selling point is production Go, a testing story is table stakes.
Proposed change
Add a v1beta/agenttest package:
- Scriptable fake provider: enqueue responses, including tool-call turns and streamed chunk sequences; assert on received messages/params.
fake := agenttest.NewProvider().
ExpectUserContains("weather").
RespondWithToolCall("get_weather", args).
ThenRespond("It's sunny in Pune.")
- Fake memory (in-memory, inspectable store/query log) and fake tools (canned results, call recording).
- Stream test helpers: collect chunks, assert ordering/types (
ChunkTypeDelta, ChunkTypeToolCall, ChunkTypeDone).
- Document in a "Testing your agents" guide under
docs/v1beta/.
From docs/AGNOSTIC_FRAMEWORK_ANALYSIS.md (branch claude/go-agnostic-framework-analysis-ekyl3a), §5 & §6.
Problem
Users have no supported way to unit-test agents without hitting a real LLM:
ProviderTypeMock,internal/llm/factory.go:26,477-484;internal/llm/mock_adapter.go) and is technically reachable viaprovider = "mock", but it is undocumented, internal-flavored, and not scriptable (fixed responses only).test/andinternal/and aren't reusable by consumers.Proposed change
Add a
v1beta/agenttestpackage:ChunkTypeDelta,ChunkTypeToolCall,ChunkTypeDone).docs/v1beta/.From
docs/AGNOSTIC_FRAMEWORK_ANALYSIS.md(branchclaude/go-agnostic-framework-analysis-ekyl3a), §5 & §6.