Release v26.04.14.2 — Discuss failure mode fixes #33

Merged
bvandeusen merged 0 commits from dev into main 2026-04-14 21:45:37 -04:00
bvandeusen commented 2026-04-14 21:45:17 -04:00 (Migrated from git.fabledsword.com)

Summary

Fixes a hallucination path in the article-discuss flow that fired when either the article body came back empty or RAG pulled in unrelated orphan notes that looked more relevant than the generic seed prompt.

  • seed_article_discussion raises a new EmptyArticleError on empty body; /briefing and /news discuss routes return 422 instead of staging an empty synthetic tool result for the model to confabulate around.
  • build_context skips RAG auto-injection (semantic + keyword fallback) when user_message matches ARTICLE_DISCUSS_SEED. The article itself is the only context the user wants on turn one. Follow-up turns keep RAG on since user-driven prompts drive the query.
  • Chat route cleans up the empty conversation it had already created when EmptyArticleError fires, so the user doesn't end up with a phantom chat entry.

Test plan

  • Click Discuss on an article with extractable body — first reply summarizes the article, no unrelated RAG notes in context.
  • Click Discuss on an article whose body extraction returns empty — 422 with a clear error, no conversation left behind (for /news), no empty assistant bubble (for briefing).
  • Follow-up question in a seeded article conversation still pulls relevant orphan notes via RAG.
## Summary Fixes a hallucination path in the article-discuss flow that fired when either the article body came back empty or RAG pulled in unrelated orphan notes that looked more relevant than the generic seed prompt. - `seed_article_discussion` raises a new `EmptyArticleError` on empty body; `/briefing` and `/news` discuss routes return 422 instead of staging an empty synthetic tool result for the model to confabulate around. - `build_context` skips RAG auto-injection (semantic + keyword fallback) when `user_message` matches `ARTICLE_DISCUSS_SEED`. The article itself is the only context the user wants on turn one. Follow-up turns keep RAG on since user-driven prompts drive the query. - Chat route cleans up the empty conversation it had already created when `EmptyArticleError` fires, so the user doesn't end up with a phantom chat entry. ## Test plan - [ ] Click Discuss on an article with extractable body — first reply summarizes the article, no unrelated RAG notes in context. - [ ] Click Discuss on an article whose body extraction returns empty — 422 with a clear error, no conversation left behind (for `/news`), no empty assistant bubble (for briefing). - [ ] Follow-up question in a seeded article conversation still pulls relevant orphan notes via RAG.
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/FabledScribe#33