You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(agents): OpenAI function-call replay silently replaces malformed arguments with {} — silent data loss on tool replay #61478
In src/agents/openai-ws-message-conversion.ts:527-533, buildAssistantMessageFromResponse() silently replaces function-call arguments with {} when JSON.parse() fails:
The original malformed-but-real argument payload is irrecoverably lost
Later replay back into OpenAI converts non-string arguments via JSON.stringify(block.arguments ?? {}) (:425-428), producing "{}" where the original content was something else
Tool replay fidelity breaks: downstream behavior can differ from the original turn
Especially problematic when arguments were partial/non-JSON from provider quirks or streaming interruptions
Suggested fix
Preserve the original string as-is when JSON parsing fails, rather than replacing with {}. The replay path should handle the raw string gracefully rather than silently destroying data.
Part of the post-#59643 adversarial review family. See #61474 for the full list. This one is independent of phase handling — it is a data-loss issue in buildAssistantMessageFromResponse() affecting OpenAI function-call replay fidelity.
changed the title [-]bug(agents): function-call replay silently replaces malformed arguments with empty object[/-][+]bug(agents): OpenAI function-call replay silently replaces malformed arguments with {} — silent data loss on tool replay[/+]on Apr 5, 2026
Activity
100yenadmin commentedon Apr 5, 2026
Part of the post-#59643 adversarial review family. See #61474 for the full list. This one is independent of phase handling — it is a data-loss issue in
buildAssistantMessageFromResponse()affecting OpenAI function-call replay fidelity.[-]bug(agents): function-call replay silently replaces malformed arguments with empty object[/-][+]bug(agents): OpenAI function-call replay silently replaces malformed arguments with {} — silent data loss on tool replay[/+]