Test helpers for driving agents deterministically without an API key.
import Agentix.Test in your test module to get:
install_mock_provider/0— makeAgentix.Test.MockProviderthe active provider and start it.completion/2— build a scripted response spec (text, tool calls, thinking).assert_tool_called/2andassert_suspended_on/2— assert on what the agent durably recorded (the canonical log and pending tool calls), not on internal state, so the assertions hold across a kill/resume.
These run async: false (the mock provider is globally named and the audit/provider
config is process-global).
Summary
Functions
Asserts the conversation is suspended on a pending tool call named tool_name.
Asserts the conversation's log contains a :tool_call event for tool_name.
Builds a response spec for the mock provider.
Installs the mock provider (sets config :agentix, :provider and starts it).
Safe to call repeatedly — resets the script if already running.
Functions
Asserts the conversation is suspended on a pending tool call named tool_name.
Asserts the conversation's log contains a :tool_call event for tool_name.
Builds a response spec for the mock provider.
Options: :tool_calls (a list of {name, arguments_map}), :thinking (reasoning
text), :usage (a usage map). Pass the result to Agentix.Test.MockProvider.script/1.
@spec install_mock_provider() :: :ok
Installs the mock provider (sets config :agentix, :provider and starts it).
Safe to call repeatedly — resets the script if already running.