feat(codemode): unify callback acceptance and support built-in references (#36771)

This commit is contained in:
Aiden Cline 2026-07-14 15:25:39 -05:00 committed by GitHub
commit ea89a2f619
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 530 additions and 124 deletions

View file

@ -270,7 +270,8 @@ export const copyOut = (value: unknown, undefinedAsNull = false): unknown => {
return null
}
if (Array.isArray(value)) {
return value.map((item) => copyOut(item, undefinedAsNull))
// Array.from densifies holes so sparse arrays normalize at the boundary like JSON does.
return Array.from(value, (item) => copyOut(item, undefinedAsNull))
}
if (value !== null && typeof value === "object" && !(value instanceof ToolReference)) {