Describe the Bug
## Problem Summary
I’m experiencing consistent timeout issues with the `sonar-deep-research` model in my production application. The model works fine for simple requests but consistently times out after approximately 60 seconds for complex report generation tasks.
Expected Behavior
work as before - output content
Actual Behavior
credit deducted but timeout, so no output created
Steps to Reproduce
API Request & Response (if applicable)
Environment
-
## Environment Details
- **Model**: `sonar-deep-research`
- **API Endpoint**: `https://api.perplexity.ai/chat/completions\`
- **Client**: Node.js with undici fetch
- **Request Timeout**: 15 minutes (client-side)
- **Issue**: Server closes connection after ~60 seconds
Logs or Screenshots (if applicable)
## Detailed Error Logs
### Error Pattern
```
SocketError: other side closed
- Code: UND_ERR_SOCKET
- Remote: 104.18.27.48:443
- Bytes Written: 8353 (request sent successfully)
- Bytes Read: 0 (no response received)
- Timeout: ~60 seconds consistently
```
### Test Results Comparison
| Test Type | Model | Status | Duration | Error |
|-----------|-------|--------|----------|-------|
| Simple Hello | sonar-deep-research | SUCCESS | 7s | None |
| Full Report | sonar-deep-research | FAILED | 60s | Socket closed |
| Same Report | sonar | SUCCESS | 21s | None |
### Complete Error Log
```json
{
“error”: “TypeError: fetch failed”,
“cause”: {
“type”: “SocketError”,
“message”: “other side closed”,
“code”: “UND_ERR_SOCKET”,
“socket”: {
“localAddress”: “26.26.26.1”,
“localPort”: 59321,
“remoteAddress”: “104.18.27.48”,
“remotePort”: 443,
“remoteFamily”: “IPv4”,
“timeout”: null,
“bytesWritten”: 8353,
“bytesRead”: 0
}
}
}
```
## Request Configuration
```json
{
“model”: “sonar-deep-research”,
“messages”: [
{
“role”: “system”,
“content”: “[COMPREHENSIVE_SYSTEM_PROMPT_FOR_INVESTMENT_ANALYSIS]”
},
{
“role”: “user”,
“content”: “Analyze Apple Inc. (AAPL) with current price $150.00”
}
],
“max_tokens”: 15000,
“temperature”: 0.0,
“search_queries”: true,
“search_recency_filter”: “month”,
“return_citations”: true,
“top_p”: 0.1,
“presence_penalty”: 0.0,
“frequency_penalty”: 0.0
}
```
## What I’ve Tried
1. **Reduced token limits** (15000 → 12000 → 10000)
2. **Shortened search recency** (month → week)
3. **Simplified prompts** (still times out)
4. **Connection optimization** (keep-alive headers)
5. **Retry mechanisms** (3 attempts with delays)
6. **Streaming approach** (same timeout issue)
## Key Observations
- **Model-specific issue**: Only `sonar-deep-research` fails; `sonar` works perfectly
- **Consistent pattern**: Always fails after ~60 seconds regardless of request complexity
- **Server-side closure**: Server accepts request but closes connection during processing
- **No response data**: Bytes written but zero bytes read
## Business Impact
- **High Priority**: Blocking production report generation
- **User Experience**: Reports fail to generate consistently
- **Cost**: API credits consumed without successful completion
- **Reliability**: Service appears unreliable to users
## Questions for the Community
1. **Is this a known issue** with `sonar-deep-research` model?
2. **Are there specific parameters** that can prevent this timeout?
3. **Is there a server-side timeout limit** for this model that’s different from others?
4. **What’s the recommended approach** for handling long-running deep research tasks?
5. **Are there any workarounds** that have worked for others?
## Request for Help
I need to use `sonar-deep-research` specifically for its deep research capabilities, but the consistent 60-second timeout makes it unusable for production. Any insights, workarounds, or solutions would be greatly appreciated.
## Contact Information
- **Application**: TopAnalyst - Investment Analysis Platform
- **Use Case**: Generating comprehensive investment reports
- **Priority**: High (blocking production usage)
-–
**Note**: This issue is preventing the use of `sonar-deep-research` model in production applications. The regular `sonar` model works fine, suggesting the issue is specific to the deep research model’s implementation or server-side processing limits.
Additional Context
Add any other context about the problem here.