Skip to content

422 Unprocessable Entity in versions 2.6.0, 2.7.0, 2.8.0 when trying to save an eval case #7019

Closed

Description

@shivammathur33

🔴 Required Information

Please ensure all items in this section are completed to allow for efficient
triaging. Requests without complete information may be rejected / deprioritized.
If an item is not applicable to you - please mark it as N/A

Describe the Bug:
#6336 seems to still persist in versions 2.6.0, 2.7.0, 2.8.0.
Upon trying to edit an eval case on an existing eval set, and hitting save (on the top right) this error is seen:
HTTP/1.1" 422 Unprocessable Entity

Steps to Reproduce:
Similar to in #6336 but adding steps anyway:

  • adk web
  • Go to localhost:8000
  • Create a new session
  • Once agent responds, got to evals tab and create a new eval (+ new)
  • Open eval set, and hit +current session (adds the session to eval set)
  • Once added, session shows in the evalset, hit edit and try to edit some message in the session
  • Once edit done, hit save on the top right
  • Save does not happen. I see this on the logs: HTTP/1.1" 422 Unprocessable Entity

Expected Behavior:
The eval set should update the eval case and give 200 OK

Observed Behavior:
HTTP/1.1" 422 Unprocessable Entity

Environment Details:

  • ADK Library Version (pip show google-adk): 2.6.0, 2.7.0, 2.8.0
  • Desktop OS:** macOS
  • Python Version (python -V): 3.11.6

Model Information:

  • Are you using LiteLLM: No
  • Which model is being used: gemini-2.5-pro

🟡 Optional Information

Providing this information greatly speeds up the resolution process.

Regression:
Did this work in a previous version of ADK? If so, which one?
no

Activity

  1. UniversePeak commented on Sep 5, 2026

    @UniversePeak
    Contributor

    I traced the current Web UI update path: the browser sends the edited conversation, sessionInput, and creationTimestamp to the eval-case PUT endpoint, while the backend validates the request as an EvalCase. The reported 422 appears to be in that request-model boundary, but I have not yet reproduced it against the affected releases. Would you be comfortable with me preparing a focused regression test and fix for this issue?

  2. shivammathur33 commented on Sep 5, 2026

    @shivammathur33
    Author

    Yes.

  3. ALDRIN121 commented on Sep 5, 2026

    @ALDRIN121
    Contributor

    Taking the RubricContent half of this. Checked first: no PR references #7019 and it's unassigned (the earlier #6515 fix only patched InvocationEvent.content).

    Root cause I found and reproduced: RubricContent.text_property is typed Optional[str] with no default, so Pydantic v2 still treats it as required. The Web UI GET serializes with response_model_exclude_none=True, dropping text_property: None, and the save PUT then fails validation with 422 — the same required-Optional trap #6515 fixed for InvocationEvent.content but missed here.

    PR up shortly with a regression test.

  4. added theissue type on Sep 7, 2026
  5. added
    eval[Component] This issue is related to evaluation
    on Sep 7, 2026
  6. surajksharma07 commented on Sep 7, 2026

    @surajksharma07
    Collaborator

    @shivammathur33 Found and fixed one real cause of this (RubricContent.text_property missing a default, same trap as #6515, PR up in #7026) but your steps don't mention adding any rubric and I couldn't get a plain session-edit save to 422 locally on main so not fully convinced #7026 covers your exact case yet. Could you check your browser's network tab on the failing save and paste the actual 422 response body or confirm whether the eval case had any rubrics attached? If you get a chance to test against #7026 once it's up let us know if it clears things on your end before we close this out.

  7. added
    request clarification[Status] The maintainer need clarification or more information from the author
    on Sep 7, 2026
  8. shivammathur33 commented on Sep 7, 2026

    @shivammathur33
    Author

    @surajksharma07 Don't think I am adding any rubrics. I had to reproduce the responses with LiteLlm since I do not have personal gemini-2.5-pro access. But I do see the same 422 response.

    Tried on main, #6919 and #7026 and encountered the same issue.

    Request payload:

    {
        "evalId": "Weather_in_chicago",
        "conversation": [
            {
                "invocationId": "e-716ee625-05b6-4a47-aeb2-d10a4a0bbdc0",
                "userContent": {
                    "parts": [
                        {
                            "text": "Weather in chicago?"
                        }
                    ],
                    "role": "user"
                },
                "finalResponse": {
                    "parts": [
                        {
                            "text": "The current weather in Chicago is clear with a temperature of 24.4 degrees Celsius and a wind speed of 13.8 km/h. The skies are currently clear, indicating good visibility and sunny conditions."
                        }
                    ],
                    "role": "model"
                },
                "intermediateData": {
                    "invocationEvents": [
                        {
                            "author": "research_agent",
                            "content": {
                                "parts": [
                                    {
                                        "functionCall": {
                                            "id": "call_xvno6vyr",
                                            "args": {
                                                "city": "chicago"
                                            },
                                            "name": "get_weather"
                                        }
                                    }
                                ],
                                "role": "model"
                            },
                            "invocationIndex": 0,
                            "toolUseIndex": 0
                        },
                        {
                            "author": "research_agent",
                            "content": {
                                "parts": [
                                    {
                                        "functionResponse": {
                                            "id": "call_xvno6vyr",
                                            "name": "get_weather",
                                            "response": {
                                                "status": "ok",
                                                "location": "Chicago, United States",
                                                "temperature_c": 24.4,
                                                "wind_speed_kmh": 13.8,
                                                "conditions": "clear sky"
                                            }
                                        }
                                    }
                                ],
                                "role": "user"
                            },
                            "invocationIndex": 0
                        }
                    ]
                },
                "creationTimestamp": 1788817941.870899
            }
        ],
        "sessionInput": {
            "appName": "research_agent",
            "userId": "user",
            "state": {}
        },
        "creationTimestamp": 1788817991.232703
    }
    

    Response payload:

    {
        "detail": [
            {
                "type": "extra_forbidden",
                "loc": [
                    "body",
                    "conversation",
                    0,
                    "intermediateData",
                    "IntermediateData",
                    "invocationEvents"
                ],
                "msg": "Extra inputs are not permitted",
                "input": [
                    {
                        "author": "research_agent",
                        "content": {
                            "parts": [
                                {
                                    "functionCall": {
                                        "id": "call_xvno6vyr",
                                        "args": {
                                            "city": "chicago"
                                        },
                                        "name": "get_weather"
                                    }
                                }
                            ],
                            "role": "model"
                        },
                        "invocationIndex": 0,
                        "toolUseIndex": 0
                    },
                    {
                        "author": "research_agent",
                        "content": {
                            "parts": [
                                {
                                    "functionResponse": {
                                        "id": "call_xvno6vyr",
                                        "name": "get_weather",
                                        "response": {
                                            "status": "ok",
                                            "location": "Chicago, United States",
                                            "temperature_c": 24.4,
                                            "wind_speed_kmh": 13.8,
                                            "conditions": "clear sky"
                                        }
                                    }
                                }
                            ],
                            "role": "user"
                        },
                        "invocationIndex": 0
                    }
                ]
            },
            {
                "type": "extra_forbidden",
                "loc": [
                    "body",
                    "conversation",
                    0,
                    "intermediateData",
                    "InvocationEvents",
                    "invocationEvents",
                    0,
                    "invocationIndex"
                ],
                "msg": "Extra inputs are not permitted",
                "input": 0
            },
            {
                "type": "extra_forbidden",
                "loc": [
                    "body",
                    "conversation",
                    0,
                    "intermediateData",
                    "InvocationEvents",
                    "invocationEvents",
                    0,
                    "toolUseIndex"
                ],
                "msg": "Extra inputs are not permitted",
                "input": 0
            },
            {
                "type": "extra_forbidden",
                "loc": [
                    "body",
                    "conversation",
                    0,
                    "intermediateData",
                    "InvocationEvents",
                    "invocationEvents",
                    1,
                    "invocationIndex"
                ],
                "msg": "Extra inputs are not permitted",
                "input": 0
            }
        ]
    }
    
  9. surajksharma07 commented on Sep 10, 2026

    @surajksharma07
    Collaborator

    @shivammathur33 Thanks for pasting the payload, that pins down a different bug than #7026. Your 422 shows extra_forbidden on invocationIndex and toolUseIndex inside conversation[0].intermediateData.invocationEvents. InvocationEvent only defines author/content/groundingMetadata and forbids extras so it looks like the Web UI's event view-model (which tracks those two indices for the transcript/diff view) is getting serialized straight into the save request instead of just the raw event fields. That's why #7026 didn't help you, it only fixes the missing-field case for rubrics not this extra-field one. Treating this as its own root cause now, will follow up once there's a fix (likely stripping those UI-only fields client-side before the PUT or relaxing InvocationEvent to tolerate unknowns).

  10. added 2 commits that reference this issue on Sep 12, 2026
    cecec57
    a553c55
  11. added a commit that references this issue on Sep 16, 2026
    a4a50a4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

eval[Component] This issue is related to evaluationrequest clarification[Status] The maintainer need clarification or more information from the author

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions