Skip to content

Don't cache agent tools during a run - #803

Merged
rm-openai merged 1 commit into
mainfrom
rm/pr803
Jun 2, 2025
Merged

rm-openai merged 1 commit into
mainfrom
rm/pr803

Conversation

@rm-openai

Copy link
Copy Markdown
Collaborator

Summary:

Towards #767. We were caching the list of tools for an agent, so if you did agent.tools.append(...) from a tool call, the next call to the model wouldn't include the new tool. THis is a bug.

Test Plan:

Unit tests. Note that now MCP tools are listed each time the agent runs (users can still cache the list_tools however).

### Summary:
Towards #767. We were caching the list of tools for an agent, so if you did `agent.tools.append(...)` from a tool call, the next call to the model wouldn't include the new tool. THis is a bug.

### Test Plan:
Unit tests. Note that now MCP tools are listed each time the agent runs (users can still cache the `list_tools` however).
@rm-openai
rm-openai merged commit d4c7a23 into main Jun 2, 2025
@rm-openai
rm-openai deleted the rm/pr803 branch June 2, 2025 18:49
KatHaruto pushed a commit to KatHaruto/openai-agents-python that referenced this pull request Jun 10, 2025
### Summary:
Towards openai#767. We were caching the list of tools for an agent, so if you
did `agent.tools.append(...)` from a tool call, the next call to the
model wouldn't include the new tool. THis is a bug.

### Test Plan:
Unit tests. Note that now MCP tools are listed each time the agent runs
(users can still cache the `list_tools` however).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants