You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 16, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 16, 2026. It is now read-only.
bug: LLM grader reports 'no response provided' when system prompt is present in input #982
When running evals with a system prompt in the input messages, the LLM grader frequently reports "No response content was provided to evaluate" even when the model actually generated a correct response. This was discovered during benchmarking with with-superpowers vs without-superpowers experiments.
Reproduction
Create an eval with a system message followed by a user message:
tests:
- id: test-1input:
- role: systemcontent: "You are a helpful assistant that thinks step by step..."
- role: usercontent: "Solve this logic puzzle..."assertions:
- type: llm-graderprompt: "Check if the response correctly solves the puzzle"
Observe that the LLM grader returns low scores with reasoning like "No response content was provided to evaluate" even when the model's actual response is correct.
Observed behavior
Experiment
Target
Actual Response
Grader Score
Grader Reasoning
without-superpowers
gemini
Correct (A=Knave, B=Knave)
1.0
Correct analysis
with-superpowers
gemini
Correct (A=Knave, B=Knave)
0.5
"No response text was provided"
without-superpowers
azure
Correct
0.97
Good solution
with-superpowers
azure
Correct
0.0
"No solution steps were included"
The contains evaluator confirms the correct content IS present in the response. The issue is specific to the LLM grader's prompt construction when system messages are in the input.
Expected behavior
The LLM grader should correctly receive and evaluate the model's response regardless of whether the input includes system messages.
The LLM grader prompt construction in packages/core/src/evaluation/evaluators/llm-grader.ts may not correctly handle multi-turn inputs with system messages when building the evaluation context for the judge model.
The buildPromptInputs function correctly includes system messages in the chatPrompt object, but never extracts them separately into the systemMessage field of the returned PromptInputs. The return statement is:
The initial analysis was incorrect. The bug is NOT caused by system message extraction. The real root cause is in resolveCustomPrompt() in packages/core/src/evaluation/evaluators/prompt-resolution.ts (lines 61-63):
When an assertion has prompt: "Check if the response...", this returns the bare prompt text as evaluatorTemplateOverride, which completely replaces the DEFAULT_EVALUATOR_TEMPLATE. Since the bare prompt has no {{output}}, {{input}}, or {{criteria}} template variables, the grader never sees the question or response.
Evidence
criteria: at test level → grader gets full template (662 input tokens) → score 1.0
prompt: in assertion → grader gets bare text only (124 input tokens) → score 0.0 ("no response provided")
This occurs with AND without system messages — system messages are irrelevant
The with-superpowers correlation was a red herring
The with-superpowers eval file happened to use prompt: in assertions while without-superpowers used criteria: at the test level. The failure was caused by the template replacement, not by system messages.
PR #983's changes (extracting systemMessage and passing systemPrompt on ProviderRequest) are a valid improvement but do NOT fix this bug. The PR needs to be revised to fix resolveCustomPrompt() instead.
Activity
christso commentedon Apr 8, 2026
Root Cause Analysis
Investigated the codebase — found two related bugs in the system message handling pipeline:
Bug 1: System message not extracted in
buildPromptInputsFile:
packages/core/src/evaluation/formatting/prompt-builder.ts(lines 80-90)The
buildPromptInputsfunction correctly includes system messages in thechatPromptobject, but never extracts them separately into thesystemMessagefield of the returnedPromptInputs. The return statement is:Bug 2: System prompt passed in wrong location
File:
packages/core/src/evaluation/orchestrator.ts(lines ~1220 and ~2673)Even if
systemMessagewere populated, it's being placed inmetadatainstead of as a directsystemPromptfield:This should be:
Effect Chain
role: systemmessage in inputbuildPromptInputsreturnssystemMessage: undefinedmetadata.systemPrompt: ''Evidence
From the benchmark results:
without-superpowers(no system message): Grader scores correctly (gemini 100%, azure 73.5%)with-superpowers(has system message): Grader fails with "no response provided" even though thecontainsevaluator confirms correct content IS presentProposed Fix
See the detailed code changes in the investigation notes. Two files need changes:
prompt-builder.ts— extract system messages and return them inPromptInputsorchestrator.ts— passsystemPromptas a direct field, not in metadatafix(core): extract system messages in prompt builder for LLM grader
christso commentedon Apr 8, 2026
Updated Root Cause (from E2E investigation)
The initial analysis was incorrect. The bug is NOT caused by system message extraction. The real root cause is in
resolveCustomPrompt()inpackages/core/src/evaluation/evaluators/prompt-resolution.ts(lines 61-63):When an assertion has
prompt: "Check if the response...", this returns the bare prompt text asevaluatorTemplateOverride, which completely replaces theDEFAULT_EVALUATOR_TEMPLATE. Since the bare prompt has no{{output}},{{input}}, or{{criteria}}template variables, the grader never sees the question or response.Evidence
criteria:at test level → grader gets full template (662 input tokens) → score 1.0prompt:in assertion → grader gets bare text only (124 input tokens) → score 0.0 ("no response provided")The
with-superpowerscorrelation was a red herringThe
with-superpowerseval file happened to useprompt:in assertions whilewithout-superpowersusedcriteria:at the test level. The failure was caused by the template replacement, not by system messages.What PR #983 actually does
PR #983's changes (extracting
systemMessageand passingsystemPrompton ProviderRequest) are a valid improvement but do NOT fix this bug. The PR needs to be revised to fixresolveCustomPrompt()instead.fix(core): treat bare assertion prompt as criteria, not template over…