Skip to content

Fix reasoningContent always null on OpenAiChatModel call path#6382

Open
jewoodev wants to merge 1 commit into
spring-projects:1.1.xfrom
jewoodev:fix-openai-call-reasoning-content-1.1.x
Open

Fix reasoningContent always null on OpenAiChatModel call path#6382
jewoodev wants to merge 1 commit into
spring-projects:1.1.xfrom
jewoodev:fix-openai-call-reasoning-content-1.1.x

Conversation

@jewoodev

@jewoodev jewoodev commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

On the 1.1.x line, OpenAiChatModel populates the reasoningContent message metadata only on the streaming path. The blocking call() path omits the entry from its metadata map, so reasoning models served through the OpenAI-compatible API (for example deepseek-reasoner) return reasoning_content on the wire while message.getMetadata().get("reasoningContent") stays null — the literal-null variant of the symptom discussed in #6375. The gap is specific to 1.1.x: on main the call path has populated this key since 2.0.0-RC1, and the streaming side — which the #6375 reporter has since confirmed as their actual case (2.0.0-RC2, stream()) — is addressed by #6373.

The fix mirrors the existing streaming entry into the call() metadata map. The regression test drives the call() path through MockRestServiceServer with a reasoning_content payload; it fails without the change (the key is absent from the metadata) and passes with it.

Verified with ./mvnw package -pl models/spring-ai-openai.

See #6375

On 1.1.x the blocking call() path in OpenAiChatModel omits the
reasoningContent entry from the generation metadata map, while the
streaming path already populates it from
ChatCompletionMessage#reasoningContent. Providers served through the
OpenAI-compatible API (for example deepseek-reasoner) return
reasoning_content on the wire, but
message.getMetadata().get("reasoningContent") is always null on the
call() path.

Mirror the streaming path by adding the same entry to the call()
metadata map, and add a regression test driving the call() path
through MockRestServiceServer with a reasoning_content payload.

See spring-projects#6375

Signed-off-by: jewoodev <jewoos15@naver.com>
@jewoodev jewoodev force-pushed the fix-openai-call-reasoning-content-1.1.x branch from 3864fcd to 35f4f59 Compare June 11, 2026 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant