kuse c0c28a3f13
fix(agents): preserve response_metadata in dynamic_context user copy (#5977)
* fix(agents): preserve response_metadata in dynamic_context user copy

The re-id'd user message was rebuilt field-by-field, dropping
response_metadata (and any other caller-attached field) from what the
run actually sees. model_copy keeps the documented {id}__user swap
while preserving the rest, matching the pattern already used by the
pii_redaction, thread_data and input_sanitization middlewares.

Fixes #5976

* fix(agents): preserve message metadata during upload injection

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-09-28 15:21:01 +08:00
..