Troubleshooting Guide
Quick reference for diagnosing and resolving common issues with voice agents, sessions, tools, and integrations.
Session Issues
Widget Key Rejected
Symptoms:
401 Unauthorizederror when creating session- "Widget key validation failed" message
Causes:
- Origin mismatch between website and widget key config
- Widget key revoked or invalid
- Tenant inactive
Solutions:
- Verify origin matches exactly (https://example.com ≠ https://www.example.com)
- Check widget key status in tenant config
- Confirm tenant status is
active - Create separate keys for www and non-www versions if needed
Session Creation Rate Limited
Symptoms:
429 Too Many Requestserror- "Please wait before starting a new session" message
Causes:
- Edge rate limit exceeded (60 req/min per IP)
- Server rate limit exceeded (12 sessions/min for widget)
- Max concurrent sessions reached
Solutions:
- Wait 60 seconds and retry
- Review traffic patterns for unusual spikes
- Increase rate limits if legitimate traffic
- Investigate potential bot attack if suspicious
Session Fails to Start
Symptoms:
- Widget opens but conversation doesn't begin
- Microphone permission granted but no audio stream
Causes:
- Agent configuration error
- Missing or invalid system prompt
- Tool validation failure
- OpenAI API error
Solutions:
- Check browser console for errors
- Verify agent configuration is complete
- Test tools in isolation
- Review OpenAI API status
Session Timeout
Symptoms:
- Session ends unexpectedly
- "Session limit exceeded" message
Causes:
- Exceeded max session duration (default: 15 minutes)
- Idle timeout (default: 5 minutes)
- Daily quota exhausted
- Heartbeat not being sent
Solutions:
- Check session duration in monitoring
- Investigate what's causing long sessions
- Review quota usage
- Verify widget is sending heartbeats every 45 seconds
Tool Issues
Tool Returns No Results
Symptoms:
- Agent says "I couldn't find anything"
- Empty result set displayed
Causes:
- API returned no matching data
- okField evaluation issue
- Query parameters too restrictive
Solutions:
- Test API directly with same parameters
- Verify okField exists in response
- Review search criteria (too specific?)
- Check API rate limits
Tool Timeout
Symptoms:
- "Request timed out" error
- Tool call takes too long
Causes:
- API response too slow
- timeoutMs set too low
- Network connectivity issue
Solutions:
- Test API latency directly
- Increase timeoutMs (default: 5000ms)
- Optimize API query performance
- Add caching to API if possible
Tool Authentication Failed
Symptoms:
401 Unauthorizedfrom API- "Authentication failed" error
Causes:
- Missing or incorrect API secret
- Secret template not interpolating correctly
- Token expired
Solutions:
- Verify secret exists in tenant config
- Check template syntax:
{{secrets.api_token}} - Rotate API token if expired
- Test API with Postman/curl using same token
Template Interpolation Error
Symptoms:
- URL has literal
{{args.param}}instead of value - API receives malformed request
Causes:
- Parameter not prefixed with
args. - Type coercion filter missing
- Parameter name mismatch
Solutions:
- Use
{{args.param}}not{{param}} - Add type filters:
{{args.limit | number}} - Verify parameter names match exactly
Agent Behavior Issues
Agent Hallucinates Data
Symptoms:
- Agent makes up product names, prices, or availability
- Agent guesses instead of using tools
Causes:
- Prompt doesn't enforce "never hallucinate" rule strongly enough
- Tools not called when they should be
- Tool response not used correctly
Solutions:
- Strengthen data_rules in prompt:
"data_rules": [ "NEVER guess product names, prices, or availability", "ALWAYS use tools to retrieve real-time data", "If a tool returns no results, say so explicitly" ] - Add examples showing correct tool usage
- Increase tool priority
Agent Too Verbose
Symptoms:
- Agent responses are too long
- Users complain about talking too much
Causes:
- Prompt style rules too lenient
- Examples show long responses
- Agent personality too chatty
Solutions:
- Add style rule: "Keep responses to 2-3 sentences unless explaining complex topic"
- Update examples with concise responses
- Adjust tone to be more direct
Agent Goes Off-Topic
Symptoms:
- Agent handles questions outside its scope
- Agent doesn't escalate when it should
Causes:
- Scope boundaries not defined clearly
- Escalation rules too vague
- Out-of-scope examples missing
Solutions:
- Define clear boundaries in prompt:
"capabilities": { "in_scope": ["room booking", "availability", "amenities"], "out_of_scope": ["cancellations", "complaints", "loyalty program"] } - Add escalation examples
- Test with off-topic questions
Wrong Tool Selected
Symptoms:
- Agent calls wrong tool for user's intent
- Multiple tool calls when one would suffice
Causes:
- Tool descriptions too similar
- Tool priority not set correctly
- Capability definitions unclear
Solutions:
- Make tool descriptions more specific
- Adjust priority (1-10, higher = more likely)
- Add
whenfield to capability:"when": "User asks for product recommendations OR compares items"
UI Component Issues
Component Doesn't Render
Symptoms:
- Expected UI component doesn't appear
- Fallback text shown instead
Causes:
- Missing required component props
- Invalid component_name
- Malformed props data
Solutions:
- Check component reference for required props
- Verify component_name spelling
- Validate props structure matches component schema
- Review browser console for rendering errors
Images Not Loading
Symptoms:
- Broken image icons in catalog_results
- Empty image placeholders
Causes:
- Invalid image URLs
- CORS issues with image CDN
- Missing image field in response
Solutions:
- Test image URLs directly in browser
- Ensure image CDN allows cross-origin requests
- Check API response has image field populated
- Provide fallback image URL
Cost Issues
Exceeding Daily Quota
Symptoms:
- Sessions blocked with "Daily quota exceeded"
- Higher costs than expected
Causes:
- More sessions than anticipated
- Longer sessions than expected
- Inefficient prompt (too many tokens)
Solutions:
- Review session volume trends
- Analyze average tokens per session
- Optimize prompt length
- Increase quota if justified by ROI
High Token Usage Per Session
Symptoms:
- Sessions consuming 10,000+ tokens
- Higher than expected costs
Causes:
- Prompt too long
- Too many tools defined
- Sessions not completing efficiently
Solutions:
- Trim system prompt (remove redundant examples)
- Remove unused tools
- Improve agent efficiency (faster completions)
- Set session duration limits
Diagnostic Commands
Check Session Status
# Query MongoDB for active sessions
db.realtime_sessions.find({ active: true })
Review Daily Usage
# Check today's token usage
db.usage_daily.find({ _id: /^d:.*:2025-01-23$/ })
Audit Rate Limits
# Check recent rate limit violations
# Review application logs for 429 errors
Getting Help
Still stuck?
- Check logs: Review browser console and server logs
- Test in isolation: Reproduce issue in development environment
- Contact support: support@strategicmachines.ai with:
- Session ID
- Timestamp of issue
- Error messages
- Steps to reproduce