Skip to content

Manual Test Procedures

These procedures verify behavior that requires live infrastructure (API keys, running services) and cannot be fully covered by unit tests.

  • A working agentzero binary on your PATH
  • An agentzero.toml config (run agentzero onboard if needed)
  • At least one provider API key configured

P1.1 Token-based auth (OpenAI, Anthropic, OpenRouter)

Section titled “P1.1 Token-based auth (OpenAI, Anthropic, OpenRouter)”
Terminal window
# Store a token
agentzero auth setup-token --provider openrouter --token sk-or-v1-...
# Verify it's stored
agentzero auth list
# Expected: shows openrouter profile with "active" status
# Verify it resolves
agentzero auth status
# Expected: shows active provider and profile
# Send a test message using the stored token
agentzero agent -m "Say hello in exactly 3 words"
# Expected: response from the provider

Pass criteria: Message returns a valid response. No “missing API key” error.

Terminal window
# Unset any stored tokens first
agentzero auth logout --provider openrouter
# Set via env var
export OPENROUTER_API_KEY="sk-or-v1-..."
# Verify it works
agentzero agent -m "Say hello in exactly 3 words"
# Expected: response from the provider

Pass criteria: Provider resolves the key from the environment variable.

Terminal window
# Ensure Ollama is running
ollama serve &
ollama pull llama3.1:8b
# Configure
agentzero onboard --provider ollama --model llama3.1:8b --yes
# Test
agentzero agent -m "What is 2+2?"
# Expected: response without any API key

Pass criteria: Response received with no authentication configured.


Terminal window
# Enable verbose output to see streaming events
agentzero -vvv agent -m "Write a haiku about rust programming"

Pass criteria: Output appears incrementally (not all at once after a delay). Debug logs show StreamChunk events.


Terminal window
# Start gateway in foreground
agentzero gateway --host 127.0.0.1 --port 18080 &
GATEWAY_PID=$!
# Wait for startup
sleep 2
# Health check
curl -s http://127.0.0.1:18080/health
# Expected: {"status":"ok"}
# Clean up
kill $GATEWAY_PID

Pass criteria: /health returns 200 with {"status":"ok"}.

Terminal window
# Start gateway (note the pairing code in output)
agentzero gateway --host 127.0.0.1 --port 18080 --new-pairing &
GATEWAY_PID=$!
sleep 2
# Exchange pairing code for bearer token
# (replace PAIRING_CODE with the code from gateway output)
TOKEN=$(curl -s -X POST http://127.0.0.1:18080/pair \
-H "Content-Type: application/json" \
-d '{"code":"PAIRING_CODE"}' | jq -r '.token')
echo "Token: $TOKEN"
# Use the token for an authenticated request
curl -s -X POST http://127.0.0.1:18080/v1/ping \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
# Expected: 200 response
# Verify unauthenticated request is rejected
curl -s -o /dev/null -w "%{http_code}" \
-X POST http://127.0.0.1:18080/v1/ping
# Expected: 401
kill $GATEWAY_PID

Pass criteria: Pairing returns a token. Token grants access. Missing token returns 401.

Terminal window
# With a running gateway and valid bearer token:
curl -s -X POST http://127.0.0.1:18080/v1/chat/completions \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-4-6",
"messages": [{"role": "user", "content": "Say hi"}]
}'
# Expected: OpenAI-format response with choices[0].message.content

Pass criteria: Response follows OpenAI chat completions format.

Terminal window
# Using websocat (install: cargo install websocat)
echo '{"message":"Hello"}' | websocat ws://127.0.0.1:18080/ws/chat \
-H "Authorization: Bearer $TOKEN"
# Expected: streaming response over WebSocket

Pass criteria: WebSocket connection established. Response messages received.


Terminal window
# Start daemon
agentzero daemon start --port 18080
# Expected: "daemon started" message with PID
# Check status
agentzero daemon status
# Expected: shows running=true, PID, host, port, uptime
# JSON status
agentzero daemon status --json
# Expected: JSON with running, pid, host, port, started_at_epoch_seconds
# Verify gateway is accessible
curl -s http://127.0.0.1:18080/health
# Expected: {"status":"ok"}
# Stop daemon
agentzero daemon stop
# Expected: "daemon stopped" message
# Verify it's stopped
agentzero daemon status
# Expected: shows running=false

Pass criteria: Full lifecycle completes without errors.

Terminal window
# Start daemon
agentzero daemon start --port 18080
# Force-kill without clean shutdown
kill -9 $(agentzero daemon status --json | jq '.pid')
# Status should auto-correct
agentzero daemon status
# Expected: running=false (auto-corrected from stale state)
# Should be able to restart
agentzero daemon start --port 18080
agentzero daemon stop

Pass criteria: Stale state is detected and corrected. Restart succeeds after crash.


Terminal window
# Refresh model catalog from provider
agentzero models refresh
# List available models
agentzero models list
# Expected: table of models with provider, ID, capabilities
# Check specific provider
agentzero doctor models
# Expected: shows reachability and model availability per provider

Pass criteria: Models list is populated. Doctor shows provider health status.


Terminal window
# Set up two providers
agentzero auth setup-token --provider openai --token sk-...
agentzero auth setup-token --provider anthropic --token sk-ant-...
# Use each provider explicitly
agentzero agent -m "Who are you?" --provider openai --model gpt-4o-mini
agentzero agent -m "Who are you?" --provider anthropic --model claude-haiku-4-5-20251001
# Switch active profile
agentzero auth use --provider anthropic --profile default
agentzero auth status
# Expected: anthropic is now active

Pass criteria: Both providers respond. Profile switching changes the default.


Record results using this format:

TestDateResultNotes
P1.1 Token authPASS/FAIL
P1.2 Env var authPASS/FAIL
P1.3 Local providerPASS/FAIL
P2.1 StreamingPASS/FAIL
P3.1 Gateway healthPASS/FAIL
P3.2 Pairing flowPASS/FAIL
P3.3 Completions APIPASS/FAIL
P3.4 WebSocket chatPASS/FAIL
P4.1 Daemon lifecyclePASS/FAIL
P4.2 Stale recoveryPASS/FAIL
P5.1 Model discoveryPASS/FAIL
P6.1 Profile switchingPASS/FAIL