---
type: email
from: "chatgpt-codex-connector[bot]" <notifications@github.com>
subject: Re: [openai/openai-agents-python] feat: #1831 Add opt-in cost

 tracking for LiteLLM models (PR #1832)
received: 2026-03-06 07:55:09
date_header: Thu, 02 Oct 2025 03:40:24 -0700
priority: normal
status: awaiting_approval
uid: 31763
---

## Email Content

**From:** "chatgpt-codex-connector[bot]" <notifications@github.com>
**Subject:** Re: [openai/openai-agents-python] feat: #1831 Add opt-in cost

 tracking for LiteLLM models (PR #1832)
**Date:** Thu, 02 Oct 2025 03:40:24 -0700

### Body (preview)

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





### 💡 Codex Review



Here are some automated review suggestions for this pull request.

    



<details> <summary>ℹ️ About Codex in GitHub</summary>

<br/>



Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

- Open a pull request for review

- Mark a draft as ready

- Comment "@codex review".



If Codex has suggestions, it will comment; otherwise it will react with 👍.





</details>



> +    track_cost: bool = False

+    """Whether to track and calculate cost for model calls.

+    When enabled, the SDK will populate `Usage.cost` with cost estimates.

+    Currently only supported for LiteLLM models. For other providers, cost will remain None.

+    Defaults to False."""



**<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub>  Preserve track_cost when resolving ModelSettings**



`ModelSettings.track_cost` is declared as a plain `bool` defaulting to `False`, while `ModelSettings.resolve()` copies every override field whose value is not `None`. If an agent enables cost tracking (`track_cost=True`) and a later call overlays another `ModelSettings()` just to tweak unrelated options (e.g. `max_tokens`), the override’s default `False` will always overwrite the original setting and silently disable cost tracking. This makes the opt-in flag effectively non‑sticky unless every call restates it, unlike the other optional booleans in this dataclass.



Useful? React with 👍 / 👎.



-- 

Reply to this email directly or view it on GitHub:

https://github.com/openai/openai-agents-python/pull/1832#pullrequestreview-3293887375

You are receiving this because you are subscribed to this thread.



Message ID: <openai/openai-agents-python/pull/1832/review/3293887375@github.com>

---

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