Troubleshooting
Troubleshooting
Common issues and solutions when developing SignalWire voice AI agents.
Quick Diagnostics
Startup Issues
Agent Won’t Start
Symptom: Python script exits immediately or with an error.
Common Causes:
- Missing dependencies
- Port already in use
Solution: Use a different port or stop the existing process.
- Invalid Python syntax
Import Errors
Symptom: ModuleNotFoundError or ImportError.
Solutions:
Function Issues
Function Not Appearing
Symptom: Function defined but not showing in --list-tools.
Check 1: Decorator syntax
Check 2: Function defined before agent.run()
Function Returns Wrong Response
Symptom: AI receives unexpected or empty response.
Check 1: Return SwaigFunctionResult
Connection Issues
Webhook Not Reached
Symptom: Functions not being called, SignalWire can’t reach agent.
Check 1: Agent is accessible from internet
Check 2: Firewall allows connections
Authentication Failures
Symptom: 401 Unauthorized errors.
Check credentials:
Set in agent:
Speech Recognition Issues
Agent Not Hearing Caller
Symptom: AI doesn’t respond to speech.
Adjust confidence threshold:
Frequent Interruptions
Symptom: AI gets interrupted too easily.
Speech Cut Off Too Early
Symptom: AI thinks caller finished speaking too soon.
Timing Issues
Caller Waits Too Long
Symptom: Long delays before AI responds.
Solutions:
Call Disconnects Unexpectedly
Symptom: Call ends without explicit hangup.
Check inactivity timeout:
DataMap Issues
Variable Not Substituting
Symptom: ${args.param} appears literally in output.
Check: Parameter name matches
Variable Syntax Reference
Skill Issues
Skill Not Loading
Symptom: Skill added but functions not available.
Check 1: Skill name is correct
Check 2: Dependencies installed
Serverless Issues
Lambda Function Errors
Check 1: Handler configuration
Check 2: Lambda timeout
Set Lambda timeout to at least 30 seconds for function processing.
Common Error Messages
Getting Help
If issues persist:
- Check SignalWire documentation
- Review SDK examples in
/examplesdirectory - Use
swaig-testfor diagnostics - Check SignalWire community forums
Advanced Debugging
Enable Debug Logging
Inspect Raw Request Data
Test Webhook Connectivity
Verify SWML Generation
Voice Quality Issues
AI Speaks Too Fast
Caller Has Trouble Understanding
Background Noise Issues
Production Issues
High Latency
Symptoms: Long delays before AI responds.
Solutions:
- Use fillers for long operations:
- Optimize database queries
- Use DataMap for simple API calls (executes on SignalWire servers)
- Consider caching frequently accessed data
Memory/Resource Issues
Symptoms: Agent crashes or becomes unresponsive.
Solutions:
- Don’t store large objects in global_data
- Clean up state between calls
- Use streaming for large responses
- Monitor memory usage in production
Concurrent Call Issues
Symptoms: State bleeds between calls.
Solutions:
- Use
global_data(per-call) instead of class attributes - Don’t use mutable default arguments
- Ensure thread safety for shared resources