OpenAI Agent using Responses API - #212
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
71c444e to
efa396f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| properties = json_schema.get("properties") | ||
| if _is_dict(properties): | ||
| json_schema["required"] = list(properties.keys()) | ||
| json_schema["properties"] = { | ||
| key: _ensure_strict_json_schema(prop_schema, path=(*path, "properties", key), root=root) | ||
| for key, prop_schema in properties.items() | ||
| } |
There was a problem hiding this comment.
Optional tool params become required in strict schema conversion
In ensure_strict_json_schema every object with properties unconditionally sets required to all property names, discarding any existing required list. Any MCP tool schema that previously had optional fields will be rewritten so all fields are mandatory when sent to the Responses API, causing OpenAI to reject tool calls that legitimately omit optional args. This affects any tool with optional inputs under the new OpenAIAgent path.
Useful? React with 👍 / 👎.
Parth220
left a comment
There was a problem hiding this comment.
Looks good.
We should try to leverage the standard model provider's agent as much as possible, in this case the Agents SDK.
| This agent uses OpenAI's Computer Use API format but executes | ||
| tools through MCP servers instead of direct implementation. | ||
| """ | ||
| class OpenAIAgent(MCPAgent): |
There was a problem hiding this comment.
Can we use Agents SDK as the core of our OpenAIAgent implementation?
Note
Introduce OpenAIAgent (Responses API), rename GenericOpenAIChatAgent to OpenAIChatAgent, add OperatorAgent with computer-use, and update CLI, docs, utils, examples, and tests accordingly.
OpenAIAgentusing OpenAI Responses API with function/tool calls, reasoning, continuation, and strict tool schema conversion.OperatorAgent(extendsOpenAIAgent) with computer-use support and Operator-style prompt; moves computer-use logic here.GenericOpenAIChatAgenttoOpenAIChatAgent; update imports and references across codebase (agents, RL, factories, examples).LiteAgentto extendOpenAIChatAgent; adjust grounded agent to new class.AgentType.OPERATOR; update CLI prompts/validation and eval flows to supportopenaiandoperatorseparately; pass model/allowed_tools appropriately.ensure_strict_json_schemafor OpenAI strict mode conversion.OpenAIAgent, revisedOperatorAgent,GeminiAgent, andOpenAIChatAgentsections with examples.OpenAIChatAgentin 2048 and evaluation scripts; adjust agent flags (operator vs openai).OpenAIAgentandOperatorAgent; update factories tests.Written by Cursor Bugbot for commit e6c4b52. This will update automatically on new commits. Configure here.