fix(viewer): show scenario run model labels#120
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the viewer’s run header to correctly display model labels for scenario-only runs by falling back to scenario (audit) metrics when prompt metrics don’t provide labels, and ensures scenario metrics provide a usable target label.
Changes:
- Render run header model labels using prompt metrics when present, otherwise fall back to scenario/audit metrics.
- In scenario/audit metrics computation, fall back from
targettotester_modelfor the target label. - Add a Node-backed regression test covering the scenario/audit target-label fallback behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| viewer/src/routes/suite/[suite_id]/[run_id]/+page.svelte | Uses falsy-aware fallbacks so empty-string prompt metrics don’t block scenario label rendering. |
| viewer/src/lib/server/metrics.ts | Sets audit target to fall back to tester_model when target is missing. |
| tests/test_viewer_metrics.py | Adds regression coverage for the audit target-label fallback via a Node TypeScript harness. |
Comment on lines
+31
to
+37
| with TemporaryDirectory() as tmp_dir: | ||
| harness_dir = Path(tmp_dir) | ||
| source = METRICS_SRC.read_text(encoding="utf-8") | ||
| source = source.replace("from '$lib/judgment.js';", "from './judgment.js';") | ||
| source = source.replace("from './dimensions.js';", "from './dimensions.js';") | ||
| (harness_dir / "metrics.ts").write_text(source, encoding="utf-8") | ||
| (harness_dir / "judgment.js").write_text( |
Collaborator
Author
There was a problem hiding this comment.
Fixed in the latest push by creating the temporary harness under viewer/, so Node sees the package ESM settings. Re-ran python -m pytest tests/test_viewer_metrics.py tests/test_viewer_run_page_server.py -q and git diff --check.
Collaborator
|
Do you have a screenshot of what changed?? |
Collaborator
Author
AaronAspinwall123
approved these changes
May 28, 2026
tangym
approved these changes
May 28, 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.


Summary
Validation