3 Commits

Author SHA1 Message Date
faber
6b2cd9da5d fix: bounded streaming body read + update stale fallback comments
Replace request.text() with a streaming reader that cancels at
512 KiB — prevents a headerless or chunked-encoding request from
buffering an unbounded payload into Worker memory. No WAF rule
dependency.

Also updates the file header and wrangler.toml comments to
describe the current in-memory fallback (not the old direct-commit
behavior).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-11 07:33:30 -04:00
faber
2a42b57cfb fix: address review blockers — streaming diagnostics, model counts, KV safety, telemetry schema
- Streaming path now returns diagnostic message (not blank) when all models fail
- All models_queried/models_total counts include Venice entries
- KV flush uses a 60s lock to prevent concurrent flush races
- TTL increased from 24h to 7 days (low-volume batches won't expire)
- Restored all previously-existing telemetry ALLOWED_FIELDS (winner_combo,
  stream, fast_stream, has_image, liquid_upgrades, encoding, etc.)
- Replaced AbortSignal.any with compatible signal forwarding pattern
- wrangler.toml no longer has fake namespace ID (commented out for local dev)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-10 16:11:42 -04:00
faber
598e067382 feat: model registry refresh, Venice API support, diagnostic errors, KV telemetry batching
- Update ULTRAPLINIAN model registry: remove 12 dead OpenRouter models, add frontier models (grok-4.5, glm-5.2, qwen3.7-max, claude-opus-4.8, gpt-5.5/5.6, etc.)
- Add Venice API as a second provider: race Venice models alongside OpenRouter in ULTRAPLINIAN mode when a Venice key is configured
- Replace generic "All models failed" with specific diagnostics (auth, credits, not_found, rate_limit)
- Buffer telemetry in Cloudflare KV and flush as bulk commits to prevent HF commit explosion

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-10 14:57:00 -04:00