Repository navigation
Description
Observed Behavior
The DevUI conversation create and update routes accept any JSON value as metadata and store it verbatim. After one such write, GET /v1/conversations returns 500 and keeps failing for every caller until the server restarts, while single conversation reads keep working, which makes the failure look random.
{"detail": "Failed to list conversations: 'NoneType' object has no attribute 'copy'"}
Expected Behavior
Metadata follows the Conversations API contract of a map with string keys and string values, so a write with any other shape is rejected with 400 at the boundary, and one bad write can never take down the list endpoint for everyone.
Steps to Reproduce
- Start a developer mode server (auth disabled is enough).
- POST
/v1/conversationswith body{"metadata": "oops-not-a-dict"}. - POST
/v1/conversations/{id}with body{"metadata": null}. - GET
/v1/conversations.
Minimal Reproduction
from fastapi.testclient import TestClient
from agent_framework_devui._server import DevServer
client = TestClient(DevServer(mode="developer", auth_enabled=False).create_app(), base_url="http://127.0.0.1")
created = client.post("/v1/conversations", json={"metadata": "oops-not-a-dict"})
assert created.status_code == 200 # string stored verbatim
client.post(f"/v1/conversations/{created.json()['id']}", json={"metadata": None})
listing = client.get("/v1/conversations")
assert listing.status_code == 500 # list crashes copying stored NoneError Messages and Stack Traces
Error listing conversations: 'NoneType' object has no attribute 'copy'
The crash is in list_conversations_by_metadata (_conversations.py): conv_data.get("metadata", {}).copy() returns the stored non-dict value, and .copy() raises.
Package Versions
agent-framework-devui: 1.0.0b261022 (main @ 4d28d0a)
Python Version
Python 3.14.8
Operating System
macOS
Regression
No
Additional Context
Both write sites (_server.py create and update routes) pass request_data.get("metadata") straight into the store. Validating at the boundary (map of string keys to string values, explicit null treated as an empty map) keeps the store safe for every reader. Fix ready once the team agrees with the direction.
Acknowledgements
- I searched existing issues and did not find a duplicate.
- I personally verified this behavior and the reproduction details are authentic.
- I will wait for explicit maintainer agreement before starting implementation of a non-trivial change.
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
eavanvalkenburg commentedon Oct 30, 2026
please use the defined issue templates and wait for the team to review before opening a PR Manohar Paturi (@ManoharPaturi)
[-]DevUI: unvalidated conversation metadata breaks the conversation list endpoint[/-][+]Python: [Bug]: DevUI conversation metadata accepts non-map values and then the conversation list fails[/+]ZedingZhang commentedon Nov 10, 2026
Hi, bro Eduard van Valkenburg (@eavanvalkenburg) , I'd like to take this on. I'll add metadata validation and regression tests to prevent the conversation list from failing.
ManoharPaturi commentedon Nov 10, 2026
sorry ZedingZhang (@ZedingZhang) it is already assigned to me and Eduard van Valkenburg (@eavanvalkenburg)
ManoharPaturi commentedon Nov 10, 2026
Thanks for the ready for implementation label. Here is the plan I intend to follow, Eduard van Valkenburg (@eavanvalkenburg), and I will hold off reopening the PR until you confirm the shape.
Validate at the two write boundaries only. The create and update routes in
_server.pyboth takerequest_dataand currently passrequest_data.get("metadata")straight into the store. Each will run the value through one shared helper that accepts a map whose keys and values are all strings, treats an explicit null or a missing key as an empty map, and answers 400 with a clear detail for every other shape. The store itself stays untouched, so internal callers that always pass well formed maps are unaffected.No defensive change in the read path. Once the write boundary holds the contract,
list_conversations_by_metadatacan keep its current copy semantics, and I would rather not broaden that loop to tolerate poisoned entries the boundary now prevents.The earlier PR Python: validate conversation metadata at the DevUI routes #9861 (closed in the earlier sweep) already carried this exact change with route level tests for the four shapes: string metadata rejected with 400, a map with a non string value rejected, explicit null accepted as an empty map, and a valid map round tripping with the list endpoint staying healthy after the poisoned writes. I will rebase that branch against current main, re run the devui suite, and reopen as a fresh PR referencing this issue.
One question before I start: should the 400 detail name the offending shape (for example "metadata must be a map of string keys to string values"), or do you prefer the shorter fixed message? Either is one line in the helper.