Conversation
…sent When the judge API key (e.g. OPENAI_API_KEY) is not configured, promptfoo throws in every llm-rubric assertion grading call. This wipes out namedScores for the whole test — including the deterministic IR metrics (MRR, Recall@k, nDCG@k) — and marks all 59 tests as errors, which the comparison step then reports as a 100% regression against the baseline. Fix by generating a runtime promptfoo config at each run that conditionally omits llm-rubric assertions when the judge's API key env var is absent. The deterministic JavaScript assertions (ir-metrics, structural) always run. - Add judgeApiKeyVar() and isJudgeKeyAvailable() helpers to judges.ts - Add buildRuntimeConfig(judgeAvailable) to run.ts that produces the appropriate promptfoo YAML with or without LLM-judged rubrics - Write the runtime config to results/promptfoo.runtime.yaml (already gitignored via results/.gitignore) before each promptfoo invocation - Emit a clear warning when LLM grading is skipped Co-authored-by: arabold <1548229+arabold@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job Evaluate search quality
fix(search-eval): skip llm-rubric assertions when judge API key is absent
Aug 18, 2026
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.
When
OPENAI_API_KEYis unset, promptfoo throws on everyllm-rubricassertion grading call. This doesn't just fail the LLM-judged metrics — it wipes out allnamedScoresfor the affected test, including the deterministic IR metrics (MRR, Recall@k, nDCG@k). Result: 59/59 tests counted as errors, all metrics at 0.000, spurious 100% regression detected, job exits 1.Changes
judges.ts— adds two helpers:judgeApiKeyVar(judge)→ returns the env var name (OPENAI_API_KEY,ANTHROPIC_API_KEY,GOOGLE_API_KEY) for a resolved judgeisJudgeKeyAvailable(judge, env?)→ returnstrueiff that key is present and non-emptyrun.ts— instead of always passing the staticpromptfoo.yaml, now generates a runtime config atresults/promptfoo.runtime.yaml(already gitignored) before each promptfoo invocation:When
judgeAvailableisfalse,buildRuntimeConfigproduces a config without the threellm-rubricassertions and thedefaultTest.options.providerblock. The deterministicjavascriptassertions (ir-metrics,structural) always run regardless of key availability.