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

ChatOpenAI.Bind_tools() Rejects GPT-6 Shell/Programmatic Tools And Lacks Responses Round-Trip Support

langchain-openai 1.6.4 rejects shell, programmatic_tool_calling, and local_shell tool types in bind_tools, and the Responses API conversion layer does not handle shell_call, shell_call_output, local_shell_call, local_shell_call_output, program, program_output items, nor preserves allowed_callers and caller fields, breaking GPT-6 programmatic tool calling end-to-end.

highConfidence 85%Langchain-OpenaiAffected Vlangchain-Openai<=1.6.4Affected Vlangchain-Core<=1.6.4

Origin Analysis

convert_to_openai_tool() only recognizes the 'function' tool type and raises ValueError for unknown types; the Responses API conversion layer lacks cases for new item types and drops caller/allowed_callers metadata during round-trip conversion.
Run the following Python code: from langchain_openai import ChatOpenAI model = ChatOpenAI(model='gpt-6-sol', api_key='test') tools = [{'type': 'shell', 'environment': {'type': 'container_auto'}}, {'type': 'programmatic_tool_calling'}, {'type': 'local_shell'}] for tool in tools: try: model.bind_tools([tool]) except ValueError as error: print(tool['type'], repr(error)) # Observe ValueError: Unsupported function for shell tool.

Fixing Code Block

Edge Case Audit

Monkey patching global classes is not thread-safe and may conflict with future official updates; the text-based serialization of response items loses type fidelity and may break streaming. The caller preservation is incomplete; the agent loop still needs a proper patch. Rollback: remove the monkey patch and upgrade to a fixed version when available. Concurrency: global patching can affect all threads; use with caution in multi-threaded environments.

Ecosystem Topology