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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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_discussionraises a newEmptyArticleErroron empty body;/briefingand/newsdiscuss routes return 422 instead of staging an empty synthetic tool result for the model to confabulate around.build_contextskips RAG auto-injection (semantic + keyword fallback) whenuser_messagematchesARTICLE_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.EmptyArticleErrorfires, so the user doesn't end up with a phantom chat entry.Test plan
/news), no empty assistant bubble (for briefing).