Add support for shell and agent_patch and generally reorganize openai agent#219
Add support for shell and agent_patch and generally reorganize openai agent#219
shell and agent_patch and generally reorganize openai agent#219Conversation
…into g/codex-support
| if self.reasoning is None: | ||
| self.reasoning = Reasoning(summary="auto") | ||
| else: | ||
| self.reasoning["summary"] = "auto" |
There was a problem hiding this comment.
Bug: Inconsistent reasoning field override in OperatorAgent
The reasoning field override has inconsistent behavior between the two branches. When reasoning is None, line 94 creates a fresh Reasoning instance, resulting in {"summary": "auto"}. When reasoning is not None, line 96 mutates the existing dict by adding the summary key, preserving other keys like {"effort": "high", "summary": "auto"}. This inconsistency means the same attribute ends up with different structures depending on initialization, potentially causing unexpected API calls. Both branches should result in the same final state to match the "override" intention in the comment.
| return MCPToolCall( | ||
| name=self._operator_computer_tool_name, | ||
| arguments=item.action.to_dict(), | ||
| id=item.call_id, |
There was a problem hiding this comment.
Bug: Missing pending_call_id assignment in operator agent
The _extract_tool_call method sets self.pending_safety_checks but doesn't set self.pending_call_id like the previous _convert_computer_tool_call method did. Later in format_tool_results at line 152, the code falls back to self.pending_call_id when call.id is missing, but since pending_call_id is never assigned, this fallback won't work and could cause computer tool results to be skipped.
Note
Refactors OpenAI/Operator agents to use strict tool schemas and native Responses tools (shell/apply_patch/computer), validates required tools, tightens computer tool params, and bumps openai to >=2.8.1.
_convert_tools_for_openai) with strict schemas and nativeshell/apply_patchsupport; addstruncation, typedreasoning/tool_choice, and generalized tool-call extraction.Omit()for unset fields);format_blocksadds imagedetail="auto";format_tool_resultssupportsresource_linkand embedded resources.openai_computer; converts MCP computer tool tocomputer_use_previewwith display/env settings (addsubuntuenv) and routescomputer_callwith pending safety checks; forces reasoning summary/truncation to auto.required_toolspresence.HudComputerToolandOpenAIComputerTool: tighten parameter types withLiterals, unify mouse buttons, and refine action handling.openaito>=2.8.1.Written by Cursor Bugbot for commit 46a3a6a. This will update automatically on new commits. Configure here.