Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions agent/process_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@ def _load_openai_cls() -> type:
if _OPENAI_CLS_CACHE is None:
from openai import OpenAI as _cls
_OPENAI_CLS_CACHE = _cls
# Apply Responses API parse_response monkey patch to handle empty/None output fields
try:
import openai.lib._parsing._responses as responses_parsing
_orig_parse_response = responses_parsing.parse_response

def _patched_parse_response(*args, **kwargs):
response = kwargs.get("response")
if response is not None:
if getattr(response, "output", None) is None:
response.output = []
return _orig_parse_response(*args, **kwargs)

responses_parsing.parse_response = _patched_parse_response
except Exception:
pass
return _OPENAI_CLS_CACHE


Expand Down