langchain - ✅(Solved) Fix [langchain-openai] `{'type': 'computer'}` tool raises ValueError: Unsupported function when using GPT-5.4 computer use tool [1 pull requests, 3 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langchain-ai/langchain#36209Fetched 2026-04-08 01:26:25
View on GitHub
Comments
3
Participants
3
Timeline
14
Reactions
1
Author
Assignees
Timeline (top)
labeled ×4commented ×3assigned ×1closed ×1

Hello team,

I am trying to use chatGPT's latest computer-use tool introduced from chatGPT 5.4. I tried to use the tool according to OpenAI's official docs. but I encountered the error below:

GPT-5.4's computer use tool ({'type': 'computer'}) is not recognized by langchain-core's tool validation, raising a ValueError.

It seems that the built-in tool name of 'computer' is not included in the white list.

Error Message

ERROR MESSAGE: Unsupported function {'type': 'computer'} To use a JSON schema as a function, it must have a top-level 'title' key to be used as the function name

TRACEBACK: Traceback (most recent call last): File "/code/chatbots/tasks.py", line 999, in chat_event_invoke result = agent.invoke( {"messages": [{"role": "user", "content": message_content}]}, config=config, context=context ) File "/usr/local/lib/python3.13/site-packages/langgraph/pregel/main.py", line 3292, in invoke for chunk in self.stream(

input,
^^^^^^
...<10 lines>...
**kwargs,
^^^^^^^^^
):
^
File "/usr/local/lib/python3.13/site-packages/langgraph/pregel/main.py", line 2725, in stream
for _ in runner.tick(
~~~~~~~~~~~^
[t for t in loop.tasks.values() if not t.writes],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<2 lines>...
schedule_task=loop.accept_push,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
):
^
File "/usr/local/lib/python3.13/site-packages/langgraph/pregel/_runner.py", line 167, in tick
run_with_retry(
~~~~~~~~~~~~~~^
t,
^^
...<10 lines>...
},
^^
)
^
File "/usr/local/lib/python3.13/site-packages/langgraph/pregel/_retry.py", line 96, in run_with_retry
return task.proc.invoke(task.input, config)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/langgraph/_internal/_runnable.py", line 656, in invoke
input = context.run(step.invoke, input, config, **kwargs)
File "/usr/local/lib/python3.13/site-packages/langgraph/_internal/_runnable.py", line 400, in invoke
ret = self.func(*args, **kwargs)
File "/usr/local/lib/python3.13/site-packages/langchain/agents/factory.py", line 1304, in model_node
result = wrap_model_call_handler(request, _execute_model_sync)
File "/usr/local/lib/python3.13/site-packages/langchain/agents/factory.py", line 265, in normalized_single
return _to_composed_result(single_handler(request, handler))
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/langchain/agents/middleware/types.py", line 1703, in wrapped
return handler(request)
File "/usr/local/lib/python3.13/site-packages/langchain/agents/factory.py", line 1268, in _execute_model_sync
model_, effective_response_format = _get_bound_model(request)
~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/langchain/agents/factory.py", line 1253, in _get_bound_model
request.model.bind_tools(
~~~~~~~~~~~~~~~~~~~~~~~~^
final_tools, tool_choice=request.tool_choice, **request.model_settings
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
),
^
File "/usr/local/lib/python3.13/site-packages/langchain_openai/chat_models/base.py", line 1989, in bind_tools
convert_to_openai_tool(tool, strict=strict) for tool in tools
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/langchain_core/utils/function_calling.py", line 572, in convert_to_openai_tool
oai_function = convert_to_openai_function(tool, strict=strict)
File "/usr/local/lib/python3.13/site-packages/langchain_core/utils/function_calling.py", line 460, in convert_to_openai_function
raise ValueError(msg)
ValueError: Unsupported function

{'type': 'computer'}

To use a JSON schema as a function, it must have a top-level 'title' key to be used as the function name.

Root Cause

Hello team,

I am trying to use chatGPT's latest computer-use tool introduced from chatGPT 5.4. I tried to use the tool according to OpenAI's official docs. but I encountered the error below:

GPT-5.4's computer use tool ({'type': 'computer'}) is not recognized by langchain-core's tool validation, raising a ValueError.

It seems that the built-in tool name of 'computer' is not included in the white list.

Fix Action

Fix / Workaround

  • This is a bug, not a usage question.
  • I added a clear and descriptive title that summarizes this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • This is not related to the langchain-community package.
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

Other Dependencies

anthropic: 0.86.0 filetype: 1.2.0 google-genai: 1.68.0 httpx: 0.28.1 jsonpatch: 1.33 langgraph: 1.1.3 openai: 2.29.0 orjson: 3.11.7 packaging: 26.0 pydantic: 2.12.5 pyyaml: 6.0.3 requests: 2.32.5 requests-toolbelt: 1.0.0 tenacity: 9.1.4 tiktoken: 0.12.0 typing-extensions: 4.15.0 uuid-utils: 0.14.1 websockets: 16.0 wrapt: 2.1.2 xxhash: 3.6.0 zstandard: 0.25.0

PR fix notes

PR #36261: fix(core): add "computer" to _WellKnownOpenAITools

Description (problem / solution / changelog)

Description

Closes #36209.

Adds "computer" to the _WellKnownOpenAITools tuple in langchain_core/utils/function_calling.py so that OpenAI's computer tool type (used in the Responses API for computer use) is passed through convert_to_openai_tool unchanged, just like computer_use_preview and other well-known tool types.

Changes

  • Added "computer" to _WellKnownOpenAITools in libs/core/langchain_core/utils/function_calling.py
  • Added a regression test verifying that a {"type": "computer", ...} dict passes through convert_to_openai_tool without modification

AI Disclosure

This contribution was made with the assistance of an AI coding agent (Claude Code).

Changed files

  • libs/core/langchain_core/utils/function_calling.py (modified, +1/-0)
  • libs/core/tests/unit_tests/utils/test_function_calling.py (modified, +13/-0)

Code Example

from langchain_openai import ChatOpenAI
from langchain.agents import create_agent

model = ChatOpenAI(
                model="gpt-5.4",
                stream_usage=True,
                use_responses_api=True,
                max_tokens=25000,
                timeout=180,
                max_retries=2,
                truncation="auto",
                reasoning={
                    "effort": "high", 
                    "summary": "auto"
                },
                # stream_options={},
                # other params...
            )
agent = create_agent(
        model=model,
        tools = [{"type": "computer"}], # <- Validation fails here.
       )

result = agent.invoke(
        {"messages": [{"role": "user", "content": "Hello"}]},
        )

---

ERROR MESSAGE:
Unsupported function {'type': 'computer'} To use a JSON schema as a function, it must have a top-level 'title' key to be used as the function name

TRACEBACK:
Traceback (most recent call last):
File "/code/chatbots/tasks.py", line 999, in chat_event_invoke
result = agent.invoke(
{"messages": [{"role": "user", "content": message_content}]},
config=config,
context=context
)
File "/usr/local/lib/python3.13/site-packages/langgraph/pregel/main.py", line 3292, in invoke
for chunk in self.stream(
~~~~~~~~~~~^
input,
^^^^^^
...<10 lines>...
**kwargs,
^^^^^^^^^
):
^
File "/usr/local/lib/python3.13/site-packages/langgraph/pregel/main.py", line 2725, in stream
for _ in runner.tick(
~~~~~~~~~~~^
[t for t in loop.tasks.values() if not t.writes],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<2 lines>...
schedule_task=loop.accept_push,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
):
^
File "/usr/local/lib/python3.13/site-packages/langgraph/pregel/_runner.py", line 167, in tick
run_with_retry(
~~~~~~~~~~~~~~^
t,
^^
...<10 lines>...
},
^^
)
^
File "/usr/local/lib/python3.13/site-packages/langgraph/pregel/_retry.py", line 96, in run_with_retry
return task.proc.invoke(task.input, config)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/langgraph/_internal/_runnable.py", line 656, in invoke
input = context.run(step.invoke, input, config, **kwargs)
File "/usr/local/lib/python3.13/site-packages/langgraph/_internal/_runnable.py", line 400, in invoke
ret = self.func(*args, **kwargs)
File "/usr/local/lib/python3.13/site-packages/langchain/agents/factory.py", line 1304, in model_node
result = wrap_model_call_handler(request, _execute_model_sync)
File "/usr/local/lib/python3.13/site-packages/langchain/agents/factory.py", line 265, in normalized_single
return _to_composed_result(single_handler(request, handler))
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/langchain/agents/middleware/types.py", line 1703, in wrapped
return handler(request)
File "/usr/local/lib/python3.13/site-packages/langchain/agents/factory.py", line 1268, in _execute_model_sync
model_, effective_response_format = _get_bound_model(request)
~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/langchain/agents/factory.py", line 1253, in _get_bound_model
request.model.bind_tools(
~~~~~~~~~~~~~~~~~~~~~~~~^
final_tools, tool_choice=request.tool_choice, **request.model_settings
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
),
^
File "/usr/local/lib/python3.13/site-packages/langchain_openai/chat_models/base.py", line 1989, in bind_tools
convert_to_openai_tool(tool, strict=strict) for tool in tools
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/langchain_core/utils/function_calling.py", line 572, in convert_to_openai_tool
oai_function = convert_to_openai_function(tool, strict=strict)
File "/usr/local/lib/python3.13/site-packages/langchain_core/utils/function_calling.py", line 460, in convert_to_openai_function
raise ValueError(msg)
ValueError: Unsupported function

{'type': 'computer'}

To use a JSON schema as a function, it must have a top-level 'title' key to be used as the function name.
RAW_BUFFERClick to expand / collapse

Checked other resources

  • This is a bug, not a usage question.
  • I added a clear and descriptive title that summarizes this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • This is not related to the langchain-community package.
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

Package (Required)

  • langchain
  • langchain-openai
  • langchain-anthropic
  • langchain-classic
  • langchain-core
  • langchain-model-profiles
  • langchain-tests
  • langchain-text-splitters
  • langchain-chroma
  • langchain-deepseek
  • langchain-exa
  • langchain-fireworks
  • langchain-groq
  • langchain-huggingface
  • langchain-mistralai
  • langchain-nomic
  • langchain-ollama
  • langchain-openrouter
  • langchain-perplexity
  • langchain-qdrant
  • langchain-xai
  • Other / not sure / general

Related Issues / PRs

#32735

Reproduction Steps / Example Code (Python)

from langchain_openai import ChatOpenAI
from langchain.agents import create_agent

model = ChatOpenAI(
                model="gpt-5.4",
                stream_usage=True,
                use_responses_api=True,
                max_tokens=25000,
                timeout=180,
                max_retries=2,
                truncation="auto",
                reasoning={
                    "effort": "high", 
                    "summary": "auto"
                },
                # stream_options={},
                # other params...
            )
agent = create_agent(
        model=model,
        tools = [{"type": "computer"}], # <- Validation fails here.
       )

result = agent.invoke(
        {"messages": [{"role": "user", "content": "Hello"}]},
        )

Error Message and Stack Trace (if applicable)

ERROR MESSAGE:
Unsupported function {'type': 'computer'} To use a JSON schema as a function, it must have a top-level 'title' key to be used as the function name

TRACEBACK:
Traceback (most recent call last):
File "/code/chatbots/tasks.py", line 999, in chat_event_invoke
result = agent.invoke(
{"messages": [{"role": "user", "content": message_content}]},
config=config,
context=context
)
File "/usr/local/lib/python3.13/site-packages/langgraph/pregel/main.py", line 3292, in invoke
for chunk in self.stream(
~~~~~~~~~~~^
input,
^^^^^^
...<10 lines>...
**kwargs,
^^^^^^^^^
):
^
File "/usr/local/lib/python3.13/site-packages/langgraph/pregel/main.py", line 2725, in stream
for _ in runner.tick(
~~~~~~~~~~~^
[t for t in loop.tasks.values() if not t.writes],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<2 lines>...
schedule_task=loop.accept_push,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
):
^
File "/usr/local/lib/python3.13/site-packages/langgraph/pregel/_runner.py", line 167, in tick
run_with_retry(
~~~~~~~~~~~~~~^
t,
^^
...<10 lines>...
},
^^
)
^
File "/usr/local/lib/python3.13/site-packages/langgraph/pregel/_retry.py", line 96, in run_with_retry
return task.proc.invoke(task.input, config)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/langgraph/_internal/_runnable.py", line 656, in invoke
input = context.run(step.invoke, input, config, **kwargs)
File "/usr/local/lib/python3.13/site-packages/langgraph/_internal/_runnable.py", line 400, in invoke
ret = self.func(*args, **kwargs)
File "/usr/local/lib/python3.13/site-packages/langchain/agents/factory.py", line 1304, in model_node
result = wrap_model_call_handler(request, _execute_model_sync)
File "/usr/local/lib/python3.13/site-packages/langchain/agents/factory.py", line 265, in normalized_single
return _to_composed_result(single_handler(request, handler))
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/langchain/agents/middleware/types.py", line 1703, in wrapped
return handler(request)
File "/usr/local/lib/python3.13/site-packages/langchain/agents/factory.py", line 1268, in _execute_model_sync
model_, effective_response_format = _get_bound_model(request)
~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/langchain/agents/factory.py", line 1253, in _get_bound_model
request.model.bind_tools(
~~~~~~~~~~~~~~~~~~~~~~~~^
final_tools, tool_choice=request.tool_choice, **request.model_settings
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
),
^
File "/usr/local/lib/python3.13/site-packages/langchain_openai/chat_models/base.py", line 1989, in bind_tools
convert_to_openai_tool(tool, strict=strict) for tool in tools
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/langchain_core/utils/function_calling.py", line 572, in convert_to_openai_tool
oai_function = convert_to_openai_function(tool, strict=strict)
File "/usr/local/lib/python3.13/site-packages/langchain_core/utils/function_calling.py", line 460, in convert_to_openai_function
raise ValueError(msg)
ValueError: Unsupported function

{'type': 'computer'}

To use a JSON schema as a function, it must have a top-level 'title' key to be used as the function name.

Description

Hello team,

I am trying to use chatGPT's latest computer-use tool introduced from chatGPT 5.4. I tried to use the tool according to OpenAI's official docs. but I encountered the error below:

GPT-5.4's computer use tool ({'type': 'computer'}) is not recognized by langchain-core's tool validation, raising a ValueError.

It seems that the built-in tool name of 'computer' is not included in the white list.

System Info

System Information

OS: Linux OS Version: #1 SMP Wed Sep 10 06:47:45 UTC 2025 Python Version: 3.13.12 (main, Mar 16 2026, 23:10:06) [GCC 14.2.0]

Package Information

langchain_core: 1.2.21 langchain: 1.2.13 langsmith: 0.7.22 langchain_anthropic: 1.4.0 langchain_google_genai: 4.2.1 langchain_openai: 1.1.12 langgraph_sdk: 0.3.12

Optional packages not installed

deepagents deepagents-cli

Other Dependencies

anthropic: 0.86.0 filetype: 1.2.0 google-genai: 1.68.0 httpx: 0.28.1 jsonpatch: 1.33 langgraph: 1.1.3 openai: 2.29.0 orjson: 3.11.7 packaging: 26.0 pydantic: 2.12.5 pyyaml: 6.0.3 requests: 2.32.5 requests-toolbelt: 1.0.0 tenacity: 9.1.4 tiktoken: 0.12.0 typing-extensions: 4.15.0 uuid-utils: 0.14.1 websockets: 16.0 wrapt: 2.1.2 xxhash: 3.6.0 zstandard: 0.25.0

extent analysis

Fix Plan

To fix the issue, you need to add a title key to the tool dictionary. The title key will be used as the function name.

Here are the steps:

  • Update the tool dictionary to include a title key.
  • The title key should have a unique and descriptive value.

Example code:

tools = [{"type": "computer", "title": "Computer Tool"}]
agent = create_agent(
    model=model,
    tools=tools
)

Alternatively, you can also define a custom tool class that inherits from langchain.agents.tools.BaseTool and overrides the __init__ method to include a title attribute.

Verification

To verify that the fix worked, you can try running the agent.invoke method again with the updated tool dictionary. If the issue is resolved, the method should execute without raising a ValueError.

Example code:

result = agent.invoke(
    {"messages": [{"role": "user", "content": "Hello"}]},
)
print(result)

If the output is as expected, it means the fix was successful.

Extra Tips

  • Make sure to update the title key in the tool dictionary to a unique and descriptive value to avoid conflicts with other tools.
  • If you are using a custom tool class, ensure that it inherits from langchain.agents.tools.BaseTool and overrides the __init__ method to include a title attribute.
  • You can also consider adding additional error handling to catch any potential exceptions that may be raised during the execution of the agent.invoke method.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

langchain - ✅(Solved) Fix [langchain-openai] `{'type': 'computer'}` tool raises ValueError: Unsupported function when using GPT-5.4 computer use tool [1 pull requests, 3 comments, 3 participants]