test(core): cover v1 provider option lowering (#30599)

This commit is contained in:
Dax 2026-06-03 13:49:28 -04:00 committed by GitHub
commit 5900345f8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 209 additions and 2 deletions

View file

@ -64,8 +64,7 @@ const anthropic: Lowerer = {
delete result.task_budget
}
if (isRecord(options.metadata) && options.metadata.userId !== undefined) {
result.metadata = { ...options.metadata, user_id: options.metadata.userId }
delete (result.metadata as Record<string, unknown>).userId
result.metadata = { ...(isRecord(result.metadata) ? result.metadata : {}), user_id: options.metadata.userId }
}
return result
},