kaxil commented on PR #73447:
URL: https://github.com/apache/airflow/pull/73447#issuecomment-5759505564

   Thanks for the careful read. I pushed 478589980b for the error message and 
the agent validation.
   
   A failed or cancelled turn now reports the SDK error's code and message. 
When a cancelled turn carries no error the message is just the turn and its 
status, so the `None` you noticed is gone. A non-dict `session_kwargs["agent"]` 
now raises `ValueError` before any session is created. The SDK's `agent` 
parameter is a `TypedDict`, so a pydantic `Agent` object was never valid there, 
and the check mainly catches `None` and typos.
   
   The `httpx2` import is already behind `pytest.importorskip` at this commit, 
next to the `AgentSession` and `Turn` skips. The bare import was in the first 
push and the lowest-dependency CI job caught it, which is why the module now 
skips as a whole on `openai<3`.
   
   I left `required_actions` and `usage` as they are. In the SDK, 
`AgentSession.required_actions` is a required `List[RequiredAction]` and 
`Turn.usage` is `Optional[TokenUsage]`, and the `None` usage case is handled. 
The client cannot produce a `None` list or a plain-dict usage, so I would 
rather not add guards for shapes that cannot occur.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to