fix(report): fail explicitly when the report body is missing in chat - #62
Open
MA1503 wants to merge 1 commit into
Open
fix(report): fail explicitly when the report body is missing in chat#62MA1503 wants to merge 1 commit into
MA1503 wants to merge 1 commit into
Conversation
…(issue nikmcfly#58, part b) ReportAgent.chat() silently filled the system prompt with a "(nonereport)" placeholder when the report failed to load or was empty — the agent then answered plausibly but without any report context, which shows up in the UI as chat answers that ignore the generated report. Now the report load is retried once and a missing/empty report raises a clear ValueError, which the API layer returns as an explicit error response instead of a hallucinated answer.
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.
Addresses part (b) of #58.
ReportAgent.chat()silently filled the system prompt with a(nonereport)placeholder when the report failed to load or was empty — the agent then answered plausibly but without any report context, which shows up in the UI as chat answers that ignore the generated report.Changes
ValueError("Report not available for this simulation yet …") when the report is missing or empty, instead of proceeding with the placeholder.Tested in our downstream fork (running in production there for two weeks): chat against a simulation without a report returns the explicit error in ~15 ms with no LLM call; chat against a simulation with a report behaves unchanged. The reporters of #58 offered to test this patch against their replication setup.