fix(codemode): stop leaking undefined into tool arguments (#37652)

This commit is contained in:
Aiden Cline 2026-07-18 13:42:16 -05:00 committed by GitHub
commit 33f1b269e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 97 additions and 20 deletions

View file

@ -44,7 +44,7 @@ export const normalizeError = (error: unknown): Diagnostic => {
message = (value as { message: string }).message
} else {
try {
message = JSON.stringify(copyOut(value)) ?? String(value)
message = JSON.stringify(copyOut(value, "json")) ?? String(value)
} catch {
message = String(value)
}

View file

@ -52,7 +52,7 @@ export const executeWithLimits = <const Provided extends Record<string, unknown>
logs,
)
const value = yield* interpreter.run(program)
const result = copyOut(copyIn(value, "Execution result"), true) as DataValue
const result = copyOut(copyIn(value, "Execution result"), "nullify") as DataValue
returned = { value: result, promises }
const warnings = yield* promises.interrupt()
return {