/insights facet extraction still silently fails after model-swap workaround (partial fix only) — related to #70011
Related to #70011 (facet extraction / narrative synthesis silently swallowing Opus API errors).
Confirmed the root cause and the ANTHROPIC_DEFAULT_OPUS_MODEL workaround from that thread only partially resolves it. Two separate failures found:
1. Stranded session-meta entries (confirmed, workaround works)
Per @bradfeld's finding in #70011: facet extraction only re-parses a session's transcript when its session-meta entry is missing or stale. With metadata cap 200/run and facet cap 50/run, sessions parsed in earlier runs but never faceted get a fresh (non-stale) meta entry and can never be revisited.
On my machine: 302 session-meta entries, only 50 facets (all dated the same day — the initial backfill run, ~6 weeks prior). 252 entries were permanently stranded.
Workaround confirmed: delete the stranded session-meta JSON files (those without a matching facets/*.json), forcing re-parse on next /insights run.
2. Facet extraction still fails for most sessions even with model swap
After clearing the stranded entries and re-running with ANTHROPIC_DEFAULT_OPUS_MODEL=claude-sonnet-5 (and separately with claude-fable-5):
- 197 sessions became eligible for facet extraction (user_message_count >= 2, duration >= 1 min)
- Round 1: 50 → 51 facets (only 1 succeeded)
- Round 2: 51 → 51 facets (0 succeeded, 0 progress)
- Narrative synthesis: only 1 of 7 sections populated ("How You Use Claude Code"), the rest stayed empty across every run
So the model swap fixes the narrative synthesis call intermittently (went from 0/7 to 1/7 sections), but does not fix the per-session facet extraction call at any meaningful rate — this suggests the silent-failure bug isn't purely "wrong model," or there's a second failure mode in the same code path (rate limiting from concurrent facet calls, or the output-token truncation reported in #78991).
Repro
- Have 150+ eligible sessions with no facets (or stranded meta entries per above)
- Run
/insightswithANTHROPIC_DEFAULT_OPUS_MODELset to a non-Opus model - Observe facet count barely moves per run despite eligible backlog and no rate-limit errors surfaced
Suggested follow-up for #70011's fix
Whatever guard/logging fix lands for the Opus facet-extraction call should be verified against a backlog of 100+ eligible sessions in one run, not just a handful — the failure rate under load looks different from the failure rate on a small test set.
Environment: macOS (darwin, arm64), Claude Code (current version at time of testing)
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗