Skip to content

fix(eval): generate Agent Engine-compliant eval session IDs - #6684

Open
SnowingFox wants to merge 1 commit into
google:mainfrom
SnowingFox:fix/6683-eval-session-id
Open

fix(eval): generate Agent Engine-compliant eval session IDs#6684
SnowingFox wants to merge 1 commit into
google:mainfrom
SnowingFox:fix/6683-eval-session-id

Conversation

@SnowingFox

Copy link
Copy Markdown

Description

Fixes #6683

The default eval session ID generator in google.adk.evaluation.local_eval_service produced 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). When VertexAiSessionService is configured, _get_or_create_eval_session() passes this generated ID straight to create_session(), Agent Engine rejects it with 400 INVALID_ARGUMENT, and the evaluation fails before inference starts.

This PR changes EVAL_SESSION_ID_PREFIX to eval-session-, so generated eval session IDs become eval-session-<uuid>, which satisfies the [a-z0-9-] constraint. The duplicate prefix constant in google.adk.cli.cli_eval (used by the API server to filter eval sessions out of session listings via startswith(...)) 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.py asserting 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 new eval-session-<uuid> format.

Notes

The issue also notes that VertexAiSessionService._SESSION_ID_PATTERN is 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.

@google-cla

google-cla Bot commented Aug 11, 2026

Copy link
Copy Markdown

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.

@adk-bot adk-bot added the eval [Component] This issue is related to evaluation label Aug 11, 2026
@i-yliu i-yliu assigned i-yliu and unassigned ankursharmas Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

eval [Component] This issue is related to evaluation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Evals fail with VertexAiSessionService because generated session IDs violate Agent Engine constraints

4 participants