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%LangChainVector StoresAgentsEmbeddingsAffected 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

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state