Repository navigation
Python: answer unsupported DevUI conversation items with a client error - #9507
Manohar Paturi (ManoharPaturi) wants to merge 1 commit into
Conversation
Eduard van Valkenburg (eavanvalkenburg)
left a comment
There was a problem hiding this comment.
The 400/404 exception split and route coverage are correct; only the import block needs to be made lint-clean.
|
|
||
| from fastapi import FastAPI, HTTPException, Request | ||
|
|
||
| from ._conversations import ConversationItemValidationError |
There was a problem hiding this comment.
Please move this relative import below the complete fastapi import group, alongside the other local imports. Ruff enables the I/isort rules, so placing it between from fastapi import ... and from fastapi.middleware... leaves this file with an unsorted import block and will fail code quality.
There was a problem hiding this comment.
Moved: the conversations import now sits with the other local imports below the complete fastapi group, and ruff isort reports the block clean. Amended into the branch; the server suite still passes (51 tests).
|
Thanks Eduard van Valkenburg (@eavanvalkenburg). I cleaned up the import block in _server.py so ConversationItemValidationError sits properly with the local package imports rather than interrupting the FastAPI group, and verified the file passes Ruff checks. |
|
The The job crashes inside griffe while loading the base (main) snapshot, before it compares the PR changes — the traceback points at the base copy of the package: Example run: https://github.com/microsoft/agent-framework/actions/runs/39810016173/job/119933441343 None of the changes in this PR touch |
Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
77e5d51 to
de4ed7b
Compare
Motivation & Context
add_itemssignals both a missing conversation and unsupported item content with a plain ValueError, and the route answers every ValueError with 404. Posting a video-only item to an existing conversation therefore reported Not Found, which reads as a wrong conversation id rather than a request the client can fix.Description & Review Guide
ConversationItemValidationError(a ValueError subclass), and the items route maps it to 400 while a missing conversation stays 404.Related Issue
Fixes #9506
AI Assistance