---
type: email
from: "chatgpt-codex-connector[bot]" <notifications@github.com>
subject: Re: [openai/openai-agents-python] Fix a bug where debug logging fails

 with Iterable objects (PR #1683)
received: 2026-03-06 07:25:44
date_header: Mon, 08 Sep 2025 14:49:05 -0700
priority: normal
status: awaiting_approval
uid: 29837
---

## Email Content

**From:** "chatgpt-codex-connector[bot]" <notifications@github.com>
**Subject:** Re: [openai/openai-agents-python] Fix a bug where debug logging fails

 with Iterable objects (PR #1683)
**Date:** Mon, 08 Sep 2025 14:49:05 -0700

### Body (preview)

@chatgpt-codex-connector[bot] commented on this pull request.







>          if _debug.DONT_LOG_MODEL_DATA:

             logger.debug("Calling LLM")

         else:

+            messages_json = json.dumps(

+                _to_dump_compatible(converted_messages),

+                indent=2,

+                ensure_ascii=False,

+            )

+            tools_json = json.dumps(

+                _to_dump_compatible(converted_tools),

+                indent=2,



**Summary**

* Materialized chat completion messages and tool payloads once and reused them for logging and API requests so iterator-based inputs are not consumed during debug output. [src/agents/models/openai_chatcompletions.pyL231-L295](https://github.com/openai/openai-agents-python/blob/c61b6e1707d8ff16396aa54ad39263faa2b4619a/src/agents/models/openai_chatcompletions.py#L231-L295)

* Applied the same dump-compatible conversion reuse to the LiteLLM model wrapper, ensuring third-party completions receive untouched iterable content. [src/agents/extensions/models/litellm_model.pyL259-L335](https://github.com/openai/openai-agents-python/blob/c61b6e1707d8ff16396aa54ad39263faa2b4619a/src/agents/extensions/models/litellm_model.py#L259-L335)

* Converted Responses API inputs and tool definitions a single time for both logging and request submission, preventing generators from being exhausted before dispatch. [src/agents/models/openai_responses.pyL243-L323](https://github.com/openai/openai-agents-python/blob/c61b6e1707d8ff16396aa54ad39263faa2b4619a/src/agents/models/openai_responses.py#L243-L323)



**Testing**

* ✅ `make format`

* ✅ `make lint`

* ⚠️ `make mypy` *(fails: missing optional dependencies numpy, litellm, sqlalchemy)*

* ⚠️ `make tests` *(fails during collection because optional dependencies litellm and numpy are not installed)*



 [View task →](https://chatgpt.com/codex/tasks/task_i_68bf4e3b76048320bb5da164c230648f)



-- 

Reply to this email directly or view it on GitHub:

https://github

---

## Suggested Actions
- [ ] Reply
- [ ] Archive
- [ ] Escalate
