Skip to content

fix(llm): Java OpenAI provider 400s on gpt-5 reasoning models with tools (spring-ai has no Responses path) #1335

Description

@dhyansraj

Summary

Cross-runtime parity follow-up to #1334. The Java native OpenAI handler (src/runtime/java/mcp-mesh-spring-ai/src/main/java/io/mcpmesh/ai/handlers/OpenAiHandler.java) uses spring-ai OpenAiChatModel / OpenAiApi, which target /v1/chat/completions only. So a Java LLM provider on a gpt-5 reasoning model (e.g. gpt-5.6-terra) with function tools 400s identically to the pre-#1334 Python path ("Function tools with reasoning_effort are not supported ... use /v1/responses").

Why it's separate from #1334

#1334 fixed the Python provider by routing reasoning+tools to the OpenAI Responses API. spring-ai has no drop-in Responses client, so the Java fix is a larger effort (a custom Responses call path, or waiting for upstream spring-ai support). TypeScript is unaffected — @ai-sdk/openai v3 already defaults to the Responses API.

Interim guidance

Because mesh delegation is provider-managed (the provider's runtime makes the OpenAI call), a Java consumer can already use reasoning+tools today by pointing at a Python (post-#1334) or TypeScript provider. Only a Java-as-provider on a reasoning model with tools is blocked.

Acceptance

Relates to #1334.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions