feat(codemode): math parity (#35609)

This commit is contained in:
Aiden Cline 2026-07-06 16:47:17 -05:00 committed by GitHub
commit ba24037e64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 172 additions and 18 deletions

View file

@ -274,6 +274,16 @@ const copyBounded = (
if (Array.isArray(value)) {
const copied = value.map((item) => copyBounded(item, label, depth + 1, seen, preserveSandboxValues))
if (preserveSandboxValues) {
// Array metadata is not serialized, but intra-sandbox copies must retain it.
for (const [key, item] of Object.entries(value)) {
if (Object.hasOwn(copied, key)) continue
if (isBlockedMember(key)) {
throw new ToolRuntimeError("InvalidDataValue", `${label} contains blocked property '${key}'.`)
}
Reflect.set(copied, key, copyBounded(item, label, depth + 1, seen, true))
}
}
seen.delete(value)
return copied
}