fix(web): preserve eval compare fields when hydrating session messages from eval history#402
Open
Dsazz wants to merge 5 commits intogoogle:mainfrom
Open
fix(web): preserve eval compare fields when hydrating session messages from eval history#402Dsazz wants to merge 5 commits intogoogle:mainfrom
Dsazz wants to merge 5 commits intogoogle:mainfrom
Conversation
Ensure session URL handling and eval comparison message mapping stay stable so selected sessions and failed-eval response fields render reliably in the chat panel. Made-with: Cursor
Precompute eval history render fields and align dynamic eval-tab lifecycle wiring to avoid refresh-time races and change-detection churn on first load. Made-with: Cursor
Use messages as the single source of truth in ChatPanel by removing the displayMessages snapshot layer and related render-key plumbing to keep the implementation simpler and easier to reason about. Made-with: Cursor
Handle 404 responses as expected empty eval history while preserving existing UI data on non-404 failures, and add targeted EvalTab tests for 404/non-404 behavior and tab visibility logic. Made-with: Cursor
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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
This PR fixes a regression where failed eval cases loaded from Eval history did not show the Actual vs Expected comparison in the chat panel, even though backend responses contained the required data.
It also adds focused hardening in eval error handling and test coverage to prevent silent regressions.
Problem
When opening a failed eval case from Eval history, the chat session loaded, but failed-message comparison details were missing:
The API payload already included these fields.
Root Cause
EvalTabComponentannotates session events with eval metadata (e.g.evalStatus,failedMetric,actualFinalResponse,expectedFinalResponse, etc.), but in the session-hydration path the event-to-message mapping dropped those fields before rendering.As a result, chat panel conditions (e.g. failed eval compare rendering) had incomplete message objects and skipped UI sections.
What Changed
1) Preserve eval metadata in message hydration path
Updated chat message mapping so eval annotation fields survive event -> message conversion consistently across session load paths.
2) Keep compare rendering valid for empty-string actual response
Ensured compare rendering checks for presence (
null/undefined) rather than truthiness, so empty actual responses still render as valid compare content.3) Harden EvalTab error handling
Improved
EvalTabHTTP error behavior:404on eval results is treated as expected “no history yet” ([])statusText === 'Not Found'checks in favor ofstatus === 4044) Add regression tests
Added/updated tests to cover:
Why This Approach
Validation
Related