perf(bedrock): avoid copying already isolated schema definitions (#50240)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Mateo Wang 2026-11-05 12:20:06 -08:00 • committed by GitHub
parent 4cdfaaa334
commit 26ba02d3ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5879,7 +5879,7 @@ def _bedrock_tools_pt(
description = name
defs = parameters.pop("$defs", {})
defs_copy = copy.deepcopy(defs) if isinstance(defs, dict) else {}
defs_copy = defs if isinstance(defs, dict) else {}
# Expand $ref references in parameters using the definitions
# Note: We don't pre-flatten defs as that causes exponential memory growth
# with circular references (see issue #19098). unpack_defs handles nested