Skip to content

Conversation

@vcshih
Copy link

@vcshih vcshih commented Jul 7, 2025

No description provided.

rm-openai and others added 30 commits May 23, 2025 13:00
## Summary
- avoid infinite recursion in visualization by tracking visited agents
- test cycle detection in graph utility

## Testing
- `make mypy`
- `make tests` 

Resolves #668
## Summary
- mention MCPServerStreamableHttp in MCP server docs
- document CodeInterpreterTool, HostedMCPTool, ImageGenerationTool and
LocalShellTool
- update Japanese translations
## Summary
- avoid AttributeError when Gemini API returns `None` for chat message
- return empty output if message is filtered
- add regression test

## Testing
- `make format`
- `make lint`
- `make mypy`
- `make tests`

Towards #744
This PR adds Portkey AI as a tracing provider. Portkey helps you take
your OpenAI agents from prototype to production.

Portkey turns your experimental OpenAI Agents into production-ready
systems by providing:

- Complete observability of every agent step, tool use, and interaction
- Built-in reliability with fallbacks, retries, and load balancing
- Cost tracking and optimization to manage your AI spend
- Access to 1600+ LLMs through a single integration
- Guardrails to keep agent behavior safe and compliant
- Version-controlled prompts for consistent agent performance


Towards #786
### Summary

Introduced the `RunErrorDetails` object to get partial results from a
run interrupted by `MaxTurnsExceeded` exception. In this proposal the
`RunErrorDetails` object contains all the fields from `RunResult` with
`final_output` set to `None` and `output_guardrail_results` set to an
empty list. We can decide to return less information.

@rm-openai At the moment the exception doesn't return the
`RunErrorDetails` object for the streaming mode. Do you have any
suggestions on how to deal with it? In the `_check_errors` function of
`agents/result.py` file.

### Test plan

I have not implemented any tests currently, but if needed I can
implement a basic test to retrieve partial data.

### Issue number

This PR is an attempt to solve issue #719 

### Checks

- [✅ ] I've added new tests (if relevant)
- [ ] I've added/updated the relevant documentation
- [ ✅] I've run `make lint` and `make format`
- [ ✅] I've made sure tests pass
Small fix:

Removing `import litellm.types` as its outside the try except block for
importing litellm so the import error message isn't displayed, and the
line actually isn't needed. I was reproducing a GitHub issue and came
across this in the process.
### Overview

This PR fixes a typo in the assert statement within the `handoff`
function in `handoffs.py`, changing `'on_input'` to `'on_handoff`' for
accuracy and clarity.

### Changes

- Corrected the word “on_input” to “on_handoff” in the docstring.

### Motivation

Clear and correct documentation improves code readability and reduces
confusion for users and contributors.

### Checklist

- [x] I have reviewed the docstring after making the change.
- [x] No functionality is affected.
- [x] The change follows the repository’s contribution guidelines.
The documentation in `docs/mcp.md` listed three server types (stdio,
HTTP over SSE, Streamable HTTP) but incorrectly stated "two kinds of
servers" in the heading. This PR fixes the numerical discrepancy.

**Changes:** 

- Modified from "two kinds of servers" to "three kinds of servers". 
- File: `docs/mcp.md` (line 11).
Changed the function comment as input_guardrails only deals with input
messages
### Overview

This PR fixes a small typo in the docstring of the
`is_strict_json_schema` abstract method of the `AgentOutputSchemaBase`
class in `agent_output.py`.

### Changes

- Corrected the word “valis” to “valid” in the docstring.

### Motivation

Clear and correct documentation improves code readability and reduces
confusion for users and contributors.

### Checklist

- [x] I have reviewed the docstring after making the change.
- [x] No functionality is affected.
- [x] The change follows the repository’s contribution guidelines.
People keep trying to fix this, but its a breaking change.
This pull request resolves #777; If you think we should introduce a new
item type for MCP call output, please let me know. As other hosted tools
use this event, I believe using the same should be good to go tho.
The EmbeddedResource from MCP tool call contains a field with type
AnyUrl that is not JSON-serializable. To avoid this exception, use
item.model_dump(mode="json") to ensure a JSON-serializable return value.
### 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).
Closes #796. Shouldn't start a busy waiting thread if there aren't any
traces.

Test plan
```
import threading
assert threading.active_count() == 1
import agents
assert threading.active_count() == 1
```
### Summary:
Allows a user to do `function_tool(is_enabled=<some_callable>)`; the
callable is called when the agent runs.

This allows you to dynamically enable/disable a tool based on the
context/env.

The meta-goal is to allow `Agent` to be effectively immutable. That
enables some nice things down the line, and this allows you to
dynamically modify the tools list without mutating the agent.

### Test Plan:
Unit tests
bump version
## Summary
- describe semantic versioning and release steps
- add release page to documentation nav

## Testing
- `make format`
- `make lint`
- `make mypy`
- `make tests`
- `make build-docs`


------
https://chatgpt.com/codex/tasks/task_i_68409d25afdc83218ad362d10c8a80a1
## Summary
- ensure `Handoff.get_transfer_message` emits valid JSON
- test transfer message validity

## Testing
- `make format`
- `make lint`
- `make mypy`
- `make tests`


------
https://chatgpt.com/codex/tasks/task_i_68432f925b048324a16878d28e850841
In deep agent workflows, each sub‐agent automatically performs an LLM
step to summarize its tool calls before returning to its parent. This
leads to:
1. Excessive latency: every nested agent invokes the LLM, compounding
delays.
2. Loss of raw tool data: summaries may strip out details the top‐level
agent needs.

We discovered that `Agent.as_tool(...)` already accepts an
(undocumented) `custom_output_extractor` parameter. By providing a
callback, a parent agent can override what the sub‐agent returns e.g.
hand back raw tool outputs or a custom slice so that only the final
agent does summarization.

---

This PR adds a “Custom output extraction” section to the Markdown docs
under “Agents as tools,” with a minimal code example.
This PR fixes issue:
#559

By adding the tool_call_id to the RunContextWrapper prior to calling
tools. This gives the ability to access the tool_call_id in the
implementation of the tool.
Sometimes users want to provide parameters specific to a model provider.
This is an escape hatch.
## Summary
- ensure `name_override` is always used in `function_schema`
- test name override when docstring info is disabled

## Testing
- `make format`
- `make lint`
- `make mypy`
- `make tests`

Resolves #860
------
https://chatgpt.com/codex/tasks/task_i_684f1cf885b08321b4dd3f4294e24ca2
I replaced the `timedelta` parameters for MCP timeouts with `float`
values, addressing issue #845 .

Given that the MCP official repository has incorporated these changes in
[this PR](modelcontextprotocol/python-sdk#941),
updating the MCP version in openai-agents and specifying the timeouts as
floats should be enough.
Add support for the new openai prompts feature.
pakrym-oai and others added 24 commits June 17, 2025 20:47
Was added to function tools before, now handoffs. Towards #918
In the REPL utility, the final output was printed after the streaming,
causing a duplication issue.

I only removed the lines within the stream mode that printed the final
output. It should not affect any other use case of the utility.

It solves a comment done in #784 .
People soemtimes use claude code to send PRs, this allows the agents.md
to be shared for that
This pull request resolves #890 and enables the translation script to
accept a file to work on.
Like I did for the TypeScript SDK project (see
openai/openai-agents-js#97), we may want to have
the labels to exclude the issues from auto-closing. Some of the issues
that have been open for a while could just need time.
### Summary
This PR fixes a duplicated line in `__init__.py`

### Checks
- [x] I've added/updated the relevant documentation
- [x] I've run `make lint` and `make format`

Co-authored-by: easonsshi <easonsshi@tencent.com>
…ices is empty (#935)

This pull request resolves #604; just checking the existence of the data and avoiding the runtime exception should make sense.
### Summary

This pull request fixes [issue
#892](#892) by
adding a missing docstring to the `fetch_user_age` tool function in
`docs/context.md`.

### Problem

Many non-OpenAI LLMs (such as Claude, Gemini, Mistral, etc.) are unable
to use the `fetch_user_age` function because it lacks a docstring. As a
result, they return responses like:

> "I cannot determine the user's age because the available tools lack
the ability to fetch user-specific information."

### Changes Made

- Added a one-line docstring to the `fetch_user_age` function
- Improved return statement to match expected tool output

```python
@function_tool
async def fetch_user_age(wrapper: RunContextWrapper[UserInfo]) -> str:
    """Fetch the age of the user. Call this function to get user's age information."""
    return f"The user {wrapper.context.name} is 47 years old"
"Intended Audience :: Developers" appears twice in the classifiers list
…639)

Set `ensure_ascii=False` in `json.dumps(...)` to allow proper Unicode
character output (e.g., Japanese).

Without this, non-ASCII characters are escaped (e.g., 日本語 →
\u65e5\u672c\u8a9e), which makes logs or exports harder to read.
… (#909)

- Add Option A (venv) and Option B (uv) in Get started section
- Mark uv as recommended to align with development workflow
- Include Windows activation commands for both options
- Resolves #884
Closes #762

**Description**

This PR updates the docstring for the `parallel_tool_calls` attribute in
the `ModelSettings` dataclass to accurately reflect its default
behavior.. The previous docstring incorrectly stated that the default of
`False`, while the actual behavior is dependent on the underlying model
provider's default.

As noted in OpenAI's (here refers as model provider) [Function
Calling](https://platform.openai.com/docs/guides/function-calling?api-mode=responses#parallel-function-calling)
documentation, "The model may choose to call multiple functions in a
single turn. You can prevent this by setting parallel_tool_calls to
false, which ensures exactly zero or one tool is called."

Therefore, when the `parallel_tool_calls` attribute in the
`ModelSettings` dataclass is set to `None` (i.e., `parallel_tool_calls:
bool | None = None`), and this value is passed directly to the API
without modification, it defers to the model provider's default behavior
for parallel tool calls. This is typically `True` for most current
providers, but it's important to acknowledge that this isn't a fixed
default within our codebase.

The new docstring is formatted for automatic documentation generation
and provides clear, accurate information for users and developers.

**Key changes:**

* **Clarified the default behavior of `parallel_tool_calls`:** Instead
of stating a fixed default, the docstring now accurately reflects that
the behavior defaults to whatever the model provider does when the
attribute is `None`.
* Improved the docstring format for compatibility with documentation
tools.
* Clarified the purpose and usage of the `parallel_tool_calls`
attribute.

**Testing:**

* Explicitly set `parallel_tool_calls=False` in both the `run_config` of
the `Runner.run` method and in the agent’s `model_settings` attribute.
* Example for `Runner.run`:
```python
Runner.run(agent, input, run_config=RunConfig(model_settings=ModelSettings(parallel_tool_calls=False)))
```
* Example for agent initialization:
```python
agent = Agent(..., model_settings=ModelSettings(parallel_tool_calls=False))
```
* Verified that when `parallel_tool_calls=False`, tools are called
sequentially.
* Confirmed that by default (without setting the attribute), tools are
called in parallel (Tested with openai models).
* Checked that the updated docstring renders correctly in the generated
documentation.
* Ensured the default value in code matches the documentation.  

**Why this is important:**

* Prevents confusion for users and developers regarding the default
behavior of `parallel_tool_calls`.
* Ensures that generated documentation is accurate and up-to-date.
* Improves overall code quality and maintainability.
Co-authored-by: chenchaomin <chenchaomin@guazi.com>
## Add MCP Tool Filtering Support

This PR implements tool filtering capabilities for MCP servers,
addressing multiple community requests for this feature.

### Problem
Currently, Agent SDK automatically fetches all available tools from MCP
servers without the ability to select specific tools. This creates
several issues:
- Unwanted tools occupy LLM context and affect tool selection accuracy
- Security concerns when limiting tool access scope
- Tool name conflicts between multiple servers
- Need for different tool subsets across different agents

### Solution
Implements a two-level filtering system:

**Server-level filtering:**
```python
server = MCPServerStdio(
    params={"command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path"]},
    allowed_tools=["read_file", "write_file"],  # whitelist
    excluded_tools=["delete_file"]  # blacklist
)
```

**Agent-level filtering:**
```python
agent = Agent(
    name="Assistant",
    mcp_servers=[server1, server2],
    mcp_config={
        "allowed_tools": {"server1": ["read_file", "write_file"]},
        "excluded_tools": {"server2": ["dangerous_tool"]}
    }
)
```

### Features
- ✅ Server-level `allowed_tools`/`excluded_tools` parameters for all MCP
server types
- ✅ Agent-level filtering via `mcp_config` 
- ✅ Hierarchical filtering (server-level first, then agent-level)
- ✅ Comprehensive test coverage (8 test cases)
- ✅ Updated documentation with examples

### Related Issues
#376, #851, #830, #863

### Testing
All existing tests pass + 8 new test cases covering various filtering
scenarios.
- Add python 3.13
- Update the homepage URL
The docstring for the `on_trace_end` method in the `TracingProcessor`
class incorrectly describes the argument `trace`. The current
description states that the argument is the trace that started, but it
should refer to the trace that has finished. This commit updates the
docstring to clarify that the argument represents the trace that has
completed, ensuring accuracy and clarity.

Changes:
- Updated the argument description for `trace` in `on_trace_end` to
clarify it refers to the trace that finished.
…ed by pydantic (#938)

Because `openai.Omit` is not a type which can be serialized by
`pydantic`, it produces difficulty in consistently
serializing/deserializing types across the agents SDK, many of which are
`pydantic` types. This adds an annotation to enable `pydantic` to
serialize `Omit`, in particular in the case of `ModelSettings` which
contains `Omit` in its `extra_headers`
There's an inconsistent import style in the tracing module where one
import uses an absolute path in line number 3 while all others use
relative imports

Additionally: Also fixed the ordering of the imports
my personal update on
#494

Key changes:
- Updated `ResponseReasoningItem` to use the correct structure with
`id`, `summary`, and `type="reasoning"` fields
- Fixed `ResponseReasoningSummaryPartAddedEvent` to include
`summary_index` parameter and use a dictionary for the `part` parameter
- Fixed `ResponseReasoningSummaryTextDeltaEvent` to include
`summary_index` parameter
- Updated `ResponseReasoningSummaryPartDoneEvent` to include
`summary_index` and use a dictionary for `part`
- Changed how the `Summary` object is accessed in tests (using `.text`
property instead of subscript notation)
- Updated `chatcmpl_converter.py` to use the `Summary` class instead of
a dictionary for better handlign


Fixes #494
### Summary
- handle safety checks when using computer tools
- expose new `on_safety_check` callback and data structure
- return acknowledged checks in computer output
- test acknowledging safety checks

### Test plan
- `make format`
- `make lint`
- `make mypy`
- `make tests`

Resolves #843

------
https://chatgpt.com/codex/tasks/task_i_684f207b8b588321a33642a2a9c96a1a
There's a small breaking change so incrementing the minor version
number.
@vcshih vcshih merged commit b103c66 into veris-ai:main Jul 7, 2025
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.