Skip to content

fix: accept LF-terminated Perplexity streams - #11

Merged
voodoohop merged 1 commit into
mainfrom
codex/perplexity-sse-framing
Sep 9, 2026
Merged

voodoohop merged 1 commit into
mainfrom
codex/perplexity-sse-framing

Conversation

@voodoohop

Copy link
Copy Markdown
Member
  • Fixes Perplexity streams being buffered as one JSON object when upstream uses LF instead of CRLF. Accepts both separators; keeps raw SSE valid when no transformer is selected.
  • Keeps the existing Perplexity adapter, developer-to-system conversion, model routes, OpenRouter fallbacks, prices, usage validation, and retries unchanged. The compatible-adapter alternative rejected developer messages, so it was discarded.
  • Reproduced the exact JSON parse failure with a captured live response. Five framing regression tests pass (LF/CRLF, byte-split UTF-8, raw passthrough); the LF tests fail on the old parser.
  • Seven live requests through local patched Portkey and Gen’s existing client/validator pass: all three Sonar models, streaming/non-streaming, high-search citations and usage, plus a developer-message request. Non-stream cost metadata stripping remains separate in fix: preserve Perplexity usage cost in non-strict mode #7.
  • Validation: 52 focused tests, formatting, diff check, and build pass. Full-suite setup failures remain; type checking reports the same 12 errors on unchanged main. No production deployment or secret changes. Complements feat: add OpenRouter fallbacks for Perplexity Sonar models pollinations#14642.

@voodoohop
voodoohop merged commit 9ed9584 into main Sep 9, 2026
2 checks passed
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.

1 participant