fix(summarization): stop logging 'All providers failed' for declined-by-design chains (#5377)
Summary
Closes #5377 (remaining acceptance item).
Status of the issue's two parts:
- Enqueue gate (part 1) — already landed. #5377 was filed against a checkout that predated #4915 (merged 2026-07-05), which wired
configureSummarizeGate(() => hasPremiumAccess())intosummarization.ts;tryApiProviderconsultscanAttemptServerSummarization()before any network dispatch, so anon/free loads issue zerosummarize-articleRPCs. That wiring is already pinned bytests/summarize-entitlement-gate.test.mts(gate-before-RPC, single choke point, 403-drift suppression). Nothing to do. - Misleading log (part 2) — fixed here. Both chain-exhausted sites (
[BETA]and normal mode) still warnedAll providers failedeven when nothing was attempted — the gate had declined every server dispatch and browser T5 was unavailable, i.e. the designed anonymous path. That outage-shaped warning is indistinguishable from a real provider failure in console triage (it cost the issue's investigation two wrong hypotheses).
Fix: both sites route through a logChainOutcome() helper. When lastAttemptedProvider is still 'none' — tryApiProvider marks attempts only after the feature + entitlement gates pass, and tryBrowserT5 only after the mlWorker.isAvailable check, so 'none' reliably means "declined by design" — it logs at debug with an accurate "skipped: no eligible provider" message. warn with All providers failed is reserved for chains where at least one provider was genuinely attempted and failed.
Type of change
- [x] Bug fix
Affected areas
- [x] AI Insights / World Brief
- [x] Other: console/Sentry triage signal quality
Checklist
- [ ] Tested on worldmonitor.app variant
- [ ] Tested on tech.worldmonitor.app variant (if applicable)
- [ ] New RSS feed domains added to
api/rss-proxy.jsallowlist (if adding feeds) - [x] No API keys or secrets committed
- [x] TypeScript compiles without errors (
npm run typecheck)
Documentation Alignment Checklist
N/A — logging-only change; no API contracts or documented behavior touched.
Verification
- Extended
tests/summarize-entitlement-gate.test.mts(source-grep suite, same idiom as the existing wiring assertions): fail sites must route throughlogChainOutcome— no unconditional string-literalAll providers failedwarn may reappear; the'none'branch must log atdebugbefore anywarn; attempt marking must stay behind the gates so'none'means declined-by-design. - 21/21 green with the fix; RED (1 fail) against the pre-fix source.
npm run typecheckclean.
Acceptance mapping (from the issue)
- "Anonymous load issues zero summarize requests" — already true via #4915's gate; pinned by the existing suite.
- "Signed-in premium path still summarizes normally" — untouched; gate/probe logic unchanged.
- "
All providers failedno longer appears on a healthy anon load; a real provider failure still surfaces atwarn" — this PR.
Screenshots
N/A — console logging change.
Generated by Claude Code
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
| Project | Deployment | Actions | Updated (UTC) |
|---|---|---|---|
| worldmonitor | Preview | Jul 26, 2026 6:37am |
Preview deployment for your docs. Learn more about Mintlify Previews.
| Project | Status | Preview | Updated (UTC) |
|---|---|---|---|
| WorldMonitor | 🟢 Ready | View Preview | Jul 25, 2026, 10:10 PM |
💡 Tip: Enable Workflows to automatically generate PRs for you.
Preview deployment for your docs. Learn more about Mintlify Previews.
| Project | Status | Preview | Updated (UTC) |
|---|---|---|---|
| WorldMonitor | 🟡 Building | – | Jul 25, 2026, 10:09 PM |
💡 Tip: Enable Workflows to automatically generate PRs for you.