WatsonxChatModel: thinking() returns null with openai/gpt-oss-120b
Author: peulvastCreated Sep 25, 2026Updated Sep 25, 2026
Related to this documentation:
When using WatsonxChatModel with the openai/gpt-oss-120b model and explicitly enabling thinking through ThinkingEffort.LOW, the thinking/reasoning part of the response is not populated.
The issue can be reproduced with the following code:
ChatModel chatModel = WatsonxChatModel.builder()
.baseUrl(CloudRegion.DALLAS)
.apiKey("tokenid")
.projectId("projectid")
.modelName("openai/gpt-oss-120b")
.thinking(ThinkingEffort.LOW)
.build();
ChatResponse chatResponse = chatModel.chat(
UserMessage.userMessage("Why is the sky blue?"));
AiMessage aiMessage = chatResponse.aiMessage();
System.out.println(aiMessage.thinking());
System.out.println(aiMessage.text());Actual behavior
aiMessage.thinking() returns:
null
while aiMessage.text() correctly contains the generated response:
The sky looks blue because of **Rayleigh scattering**...
Expected behavior
Since thinking is explicitly enabled with:
.thinking(ThinkingEffort.LOW)
and openai/gpt-oss-120b supports reasoning, I would expect the reasoning/thinking content returned by watsonx.ai to be exposed through:
aiMessage.thinking()
rather than returning null.
Source: langchain4j/langchain4j