AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

OpenAI Computer-Use Tool Calls Are Not Executed As LangChain Tool Calls

When using ChatOpenAI with use_responses_api=True and a computer tool, OpenAI returns a computer_call item in the response, but LangChain does not convert it into AIMessage.tool_calls, so the standard agent loop cannot execute the computer action.

highConfidence 85%LangChainAffected V1.1.14

Origin Analysis

The langchain-openai Responses API adapter does not map the `computer_call` output item to LangChain `AIMessage.tool_calls`; instead it puts the raw computer_call object into `AIMessage.content`, preventing tool execution.
1. Install langchain-openai 1.1.14 and set up ChatOpenAI with use_responses_api=True. 2. Define a computer tool as {'type': 'computer'}. 3. Create an agent with create_agent(model, tools=[computer_tool]) and invoke with a prompt asking for a screenshot. 4. Observe that the agent loop does not call the computer tool; the computer_call appears in AIMessage.content instead of tool_calls.

Fixing Code Block

Edge Case Audit

This patch assumes a stable response structure from OpenAI; if OpenAI changes the computer_call schema, the code will break. It may need updates for multiple actions (multiple tool calls share same call_id). Rebinding a private method may conflict with future upstream changes; prefer upstream PR. Rollback: remove monkey patch and upgrade/downgrade to official version when available.

Ecosystem Topology