Skip to content

Abstain instead of fabricating a report when no content was gathered#1799

Open
aaravanmay wants to merge 1 commit into
assafelovic:mainfrom
aaravanmay:abstain-on-empty-context
Open

Abstain instead of fabricating a report when no content was gathered#1799
aaravanmay wants to merge 1 commit into
assafelovic:mainfrom
aaravanmay:abstain-on-empty-context

Conversation

@aaravanmay

Copy link
Copy Markdown

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_report passes 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 main and passes with the change. Happy to make it a config flag if you'd rather keep the current behavior opt-in.

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>
@aaravanmay

Copy link
Copy Markdown
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant