Skip to content

OpenAI Agent using Responses API - #212

Merged
jdchawla29 merged 7 commits into
mainfrom
j/openai-responses
Nov 24, 2025
Merged

jdchawla29 merged 7 commits into
mainfrom
j/openai-responses

Conversation

@jdchawla29

@jdchawla29 jdchawla29 commented Nov 24, 2025

Copy link
Copy Markdown
Collaborator

Note

Introduce OpenAIAgent (Responses API), rename GenericOpenAIChatAgent to OpenAIChatAgent, add OperatorAgent with computer-use, and update CLI, docs, utils, examples, and tests accordingly.

  • Agents:
    • Add OpenAIAgent using OpenAI Responses API with function/tool calls, reasoning, continuation, and strict tool schema conversion.
    • Introduce OperatorAgent (extends OpenAIAgent) with computer-use support and Operator-style prompt; moves computer-use logic here.
    • Rename GenericOpenAIChatAgent to OpenAIChatAgent; update imports and references across codebase (agents, RL, factories, examples).
    • Update LiteAgent to extend OpenAIChatAgent; adjust grounded agent to new class.
  • CLI/Eval:
    • Add AgentType.OPERATOR; update CLI prompts/validation and eval flows to support openai and operator separately; pass model/allowed_tools appropriately.
  • Utils:
    • Add ensure_strict_json_schema for OpenAI strict mode conversion.
  • Docs:
    • Expand agents reference: new OpenAIAgent, revised OperatorAgent, GeminiAgent, and OpenAIChatAgent sections with examples.
  • Examples:
    • Switch to OpenAIChatAgent in 2048 and evaluation scripts; adjust agent flags (operator vs openai).
  • Tests:
    • Add/expand tests for OpenAIAgent and OperatorAgent; update factories tests.

Written by Cursor Bugbot for commit e6c4b52. This will update automatically on new commits. Configure here.

@jdchawla29

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread hud/utils/strict_schema.py
@jdchawla29
jdchawla29 marked this pull request as ready for review November 24, 2025 07:12
Comment thread hud/agents/operator.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +57 to +63
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()
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 Parth220 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

We should try to leverage the standard model provider's agent as much as possible, in this case the Agents SDK.

Comment thread hud/agents/operator.py
Comment thread hud/agents/openai.py
This agent uses OpenAI's Computer Use API format but executes
tools through MCP servers instead of direct implementation.
"""
class OpenAIAgent(MCPAgent):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use Agents SDK as the core of our OpenAIAgent implementation?

Comment thread hud/agents/operator.py
@jdchawla29
jdchawla29 merged commit 8f1c8cb into main Nov 24, 2025
11 checks passed
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