Found during the 2026-07-05 OpenRouter spend investigation. This silently ~doubles the whyMatters share of digest-notifications LLM spend.
Evidence
api/internal/brief-why-matters.ts:
- L82:
const shadowEnabled = env.BRIEF_WHY_MATTERS_SHADOW !== '0' — default ON.
- Sample pct defaults to 100 when unset/invalid (L373 warning path confirms).
- L431:
await Promise.allSettled([analystPath, geminiPath]) — two full gemini-2.5-flash completions per cache-miss story; one is used, the other stored only as an observability diff.
digest-notifications runs */30 * * * * on Railway with brief-llm.mjs pinned to OpenRouter (skipProviders:['ollama','groq']), so both calls bill OpenRouter.
Fix
If the shadow comparison window has served its purpose, set BRIEF_WHY_MATTERS_SHADOW=0 on the Railway service (immediate ~50% cut to whyMatters spend, zero correctness impact) — or drop BRIEF_WHY_MATTERS_SHADOW_SAMPLE_PCT to a small value (e.g. 5) if ongoing drift detection is still wanted. Consider flipping the code default to off so a fresh deploy isn't silently 2×.
Found during the 2026-07-05 OpenRouter spend investigation. This silently ~doubles the whyMatters share of digest-notifications LLM spend.
Evidence
api/internal/brief-why-matters.ts:const shadowEnabled = env.BRIEF_WHY_MATTERS_SHADOW !== '0'— default ON.await Promise.allSettled([analystPath, geminiPath])— two fullgemini-2.5-flashcompletions per cache-miss story; one is used, the other stored only as an observability diff.digest-notifications runs
*/30 * * * *on Railway withbrief-llm.mjspinned to OpenRouter (skipProviders:['ollama','groq']), so both calls bill OpenRouter.Fix
If the shadow comparison window has served its purpose, set
BRIEF_WHY_MATTERS_SHADOW=0on the Railway service (immediate ~50% cut to whyMatters spend, zero correctness impact) — or dropBRIEF_WHY_MATTERS_SHADOW_SAMPLE_PCTto a small value (e.g. 5) if ongoing drift detection is still wanted. Consider flipping the code default to off so a fresh deploy isn't silently 2×.