fix(eval): generate Agent Engine-compliant eval session IDs - #6684
Open
SnowingFox wants to merge 1 commit into
Open
fix(eval): generate Agent Engine-compliant eval session IDs#6684SnowingFox wants to merge 1 commit into
SnowingFox wants to merge 1 commit into
Conversation
|
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.
Description
Fixes #6683
The default eval session ID generator in
google.adk.evaluation.local_eval_serviceproduced IDs of the form___eval___session___<uuid>. The underscores violate the custom session ID constraints enforced by Vertex AI Agent Engine (only lowercase letters, digits and hyphens, with an alphanumeric first/last character). WhenVertexAiSessionServiceis configured,_get_or_create_eval_session()passes this generated ID straight tocreate_session(), Agent Engine rejects it with400 INVALID_ARGUMENT, and the evaluation fails before inference starts.This PR changes
EVAL_SESSION_ID_PREFIXtoeval-session-, so generated eval session IDs becomeeval-session-<uuid>, which satisfies the[a-z0-9-]constraint. The duplicate prefix constant ingoogle.adk.cli.cli_eval(used by the API server to filter eval sessions out of session listings viastartswith(...)) is updated in sync so eval sessions remain hidden from the listing.Verification
Added a unit regression test
tests/unittests/evaluation/test_eval_session_id.pyasserting that_get_session_id()returns an ID matching^[a-z0-9-]+$with alphanumeric first/last characters. The test fails against the previous___eval___session___<uuid>format and passes with the neweval-session-<uuid>format.Notes
The issue also notes that
VertexAiSessionService._SESSION_ID_PATTERNis more permissive than Agent Engine's real constraint. Tightening it would be a behavior change that could reject other currently-accepted session IDs (several existing tests use underscore-containing session IDs), so this PR keeps the fix minimal and only corrects the generated eval session IDs.