Skip to content

fix: enable streaming for sonar-deep-research#85

Merged
kesku merged 1 commit intoperplexityai:mainfrom
kesku:fix/deep-research-streaming
Feb 16, 2026
Merged

fix: enable streaming for sonar-deep-research#85
kesku merged 1 commit intoperplexityai:mainfrom
kesku:fix/deep-research-streaming

Conversation

@kesku
Copy link
Collaborator

@kesku kesku commented Feb 16, 2026

Fixes #83

sonar-deep-research performs multi-step web research that can take minutes. Without streaming, the idle HTTP connection is dropped by Cloudflare at ~60s. This adds stream: true for sonar-deep-research requests and consumes the SSE response, which keeps the connection alive via keep-alive pings.

Changes:

  • Add consumeSSEStream() to buffer SSE chunks into a ChatCompletionResponse
  • Conditionally enable stream: true when model is sonar-deep-research
  • Update test mock for streaming path

@kesku kesku merged commit c58aa16 into perplexityai:main Feb 16, 2026
1 check passed
@kesku kesku deleted the fix/deep-research-streaming branch February 16, 2026 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perplexity_research (sonar-deep-research) fails with fetch error due to missing stream:true

1 participant