Skip to content

fix(engines): repair DeepSeek + Perplexity scans, clarify quota failures - #115

Merged
ralyodio merged 1 commit into
masterfrom
fix/engine-deepseek-v4-perplexity-timeout
Jul 25, 2026
Merged

ralyodio merged 1 commit into
masterfrom
fix/engine-deepseek-v4-perplexity-timeout

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

This work was committed on this branch earlier but no PR was ever opened, so it never reached master — meaning prod is still sending the retired deepseek-chat alias and every DeepSeek scan 400s with:

The supported API model names are deepseek-v4-pro or deepseek-v4-flash, but you passed deepseek-chat.

What it fixes

DeepSeek — the deepseek-chat alias was retired; GET /models now serves only deepseek-v4-flash and deepseek-v4-pro. Defaults to flash (matches this engine's "quick, lightweight" billing), overridable via DEEPSEEK_MODEL. The old 8K output cap was a deepseek-chat limit — V4 accepts 64K and is a reasoning model whose reasoning_content draws from the same budget, so 8K would truncate the JSON report.

Perplexity — key and model were fine; the shared 90s client timeout was too tight. Sonar does its web retrieval before emitting response headers and a real audit measures ~221s, so every run died as "Request timed out." Now 5min × 2 attempts with a matching stuck window.

Timeouts are now per-engine rather than hardcoded in oa-compat. The SDK clears its timer as soon as fetch() resolves, so on a streaming call it bounded time-to-first-byte only — a provider that opens the stream then stalls was unbounded. An idle watchdog now aborts on a gap between chunks, which is what makes raising Perplexity's header timeout safe.

OpenAI GPT-5 Mini and Sakana Fugu are not code bugs — both accounts are out of prepaid credit (verified: OpenAI insufficient_quota; Sakana "Prepaid credit balance is exhausted"). Both surfaced as generic rate limits, pointing at a per-minute cap that was never the problem, and Fugu's message hardcoded "after 5 attempts" while maxRetries was 2. They now distinguish out-of-credit from throttling and quote the provider.

Verification

Verified live against crawlproof.com when originally written: DeepSeek 84/100 in 57s, Perplexity 93/100 in 3m41s.

Re-verified now on top of the Slop Score merge (6c1a886): merges cleanly with no conflicts, tsc --noEmit clean, 473 tests pass. Confirmed prod Railway env has no DEEPSEEK_MODEL set, so the new deepseek-v4-flash default takes effect on deploy.

🤖 Generated with Claude Code

DeepSeek and Perplexity failed on every run. Two distinct causes:

- DeepSeek retired the `deepseek-chat` alias; GET /models now serves only
  deepseek-v4-flash and deepseek-v4-pro, and the old name 400s. Default to
  flash (matches this engine's "quick, lightweight" billing), overridable
  via DEEPSEEK_MODEL. The 8K output cap was a deepseek-chat limit — V4
  accepts 64K and is a reasoning model whose reasoning_content draws from
  the same budget, so 8K would truncate the JSON report.

- Perplexity's key and model are fine; the shared 90s client timeout was
  too tight. Sonar does its web retrieval before emitting response headers,
  and a real audit measures ~221s, so every run died as "Request timed
  out." Give it 5min x 2 attempts and widen its stuck window to match.

Timeouts are now per-engine rather than hardcoded in oa-compat. The SDK
clears its timer as soon as fetch() resolves, so on a streaming call it
bounds time-to-first-byte only — a provider that opens the stream then
stalls was unbounded. Added an idle watchdog that aborts on a gap between
chunks, which is what makes raising Perplexity's header timeout safe.

OpenAI GPT-5 Mini and Sakana Fugu are not code bugs — both accounts are
out of prepaid credit (verified: OpenAI insufficient_quota; Sakana
"Prepaid credit balance is exhausted"). Both surfaced as generic rate
limits, pointing at a per-minute cap that was never the problem, and
Fugu's message hardcoded "after 5 attempts" while maxRetries was 2. They
now distinguish out-of-credit from throttling and quote the provider.

Verified live against crawlproof.com: DeepSeek 84/100 in 57s,
Perplexity 93/100 in 3m41s.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit bcf1bb6 into master Jul 25, 2026
8 checks passed
@ralyodio
ralyodio deleted the fix/engine-deepseek-v4-perplexity-timeout branch July 25, 2026 22:42
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