Abstain instead of fabricating a report when no content was gathered#1799
Open
aaravanmay wants to merge 1 commit into
Open
Abstain instead of fabricating a report when no content was gathered#1799aaravanmay wants to merge 1 commit into
aaravanmay wants to merge 1 commit into
Conversation
ReportGenerator.write_report passed the gathered context straight to the report LLM with no check, so when every retriever returned empty (rate-limited, blocked, or no hits) it wrote a confident, sourced-looking report from the model's priors (including invented citations). Abstain with a clear message when no research content was gathered. Includes a regression test (mocks the report LLM). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author
|
The fabricate-on-empty-retrieval bug in this PR is one instance of a class: the agent acting confidently on empty/stale/truncated tool data. I built faultline (open source) to catch that class deterministically in CI — the abstain-on-empty invariant is ~5 lines. I can PR a suite + a shadow-mode GitHub Action (continue-on-error, never blocks merges) so you just see what it flags for a week. May I? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While testing how GPT Researcher handles empty retrievals, I found it produces a confident, fully-sourced-looking report (with invented citations) when every source returns no content — searches rate-limited, blocked, or genuinely empty.
ReportGenerator.write_reportpasses the (empty) context straight to the report LLM with no check, so the model fills in from its priors.This adds a guard: if no research content was gathered, abstain with a clear message instead of writing. Includes a regression test (mocks the report LLM, so no API call) that fails on
mainand passes with the change. Happy to make it a config flag if you'd rather keep the current behavior opt-in.