Skip to content

fix(report): fail explicitly when the report body is missing in chat - #62

Open
MA1503 wants to merge 1 commit into
nikmcfly:mainfrom
MA1503:fix/report-chat-missing-report
Open

fix(report): fail explicitly when the report body is missing in chat#62
MA1503 wants to merge 1 commit into
nikmcfly:mainfrom
MA1503:fix/report-chat-missing-report

Conversation

@MA1503

@MA1503 MA1503 commented Jul 24, 2026

Copy link
Copy Markdown

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

  • Retry the report load once, then raise a clear ValueError ("Report not available for this simulation yet …") when the report is missing or empty, instead of proceeding with the placeholder.
  • The API layer returns that message as an explicit error response instead of a hallucinated answer.

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.

…(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.
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