Azure / Azure/azure-sdk-for-java
[BUG] Chat request fails with unknown reasoning.isValid after creating a new agent version
- Dominant language
- Java
- Stars
- 2.6k
- Forks
- 2.2k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 178
Description
**Describe the bug**
After updating the instructions of a prompt agent that has a reasoning configuration and creating a new version, subsequent chat requests fail with:
400: Unknown parameter: 'reasoning.isValid'
During debugging, an isValid property was found in the agent’s reasoning configuration. This property does not appear to be supported by the service API and may be related to the serialization of Reasoning.isValid().
**Exception or Stack Trace**
```text
com.openai.errors.BadRequestException: 400: Unknown parameter: 'reasoning.isValid'
at com.openai.errors.BadRequestException$Builder.build(BadRequestException.kt:88)
at com.openai.core.handlers.ErrorHandler$errorHandler$1.handle(ErrorHandler.kt:48)
at com.openai.core.handlers.ErrorHandler$errorHandler$1.handle(ErrorHandler.kt:40)
at com.openai.services.blocking.ResponseServiceImpl$WithRawResponseImpl.create(ResponseServiceImpl.kt:143)
at com.openai.services.blocking.ResponseServiceImpl.create(ResponseServiceImpl.kt:62)
at com.openai.services.blocking.ResponseService.create(ResponseService.kt:64)
at com.azure.ai.agents.ResponsesClient.createAzureResponse(ResponsesClient.java:66)
```
**To Reproduce**
- Retrieve the latest agent version using AgentsClient.
- Obtain its PromptAgentDefinition.
- Change only instructions.
- Create a new agent version using the typed createAgentVersion method.
- Send a response request using the newly created/latest agent version.
**Code Snippet**
```java
final AgentVersionDetails latestVersion = agentsClient
.getAgent(agentName)
.getVersions()
.getLatest();
final PromptAgentDefinition definition =
(PromptAgentDefinition) latestVersion.getDefinition();
definition.setInstructions("Updated system prompt");
agentsClient.createAgentVersion(
agentName,
definition,
null,
latestVersion.getMetadata(),
latestVersion.getDescription()
);
// A subsequent response request using the latest agent version fails with:
// 400: Unknown parameter: 'reasoning.isValid'
```
**Expected behavior**
Creating a new version after updating instructions should preserve the existing agent definition, and the resulting version should remain usable for response requests.
**Setup (please complete the following information):**
- OS: Ubuntu 25.04, Linux kernel 6.14.0-37-generic, x86-64
- IDE: IntelliJ IDEA 2025.3
- Libraries:
- com.azure:azure-ai-agents:2.0.0
- com.openai:openai-java:4.19.0
- com.openai:openai-java-core:4.19.0
- com.azure:azure-core:1.57.1
- com.azure:azure-core-http-netty:1.16.3
- Java version: Amazon Corretto 25.0.2
- App Server/Environment: Spring Boot application using embedded Tomcat, run from IntelliJ IDEA
- Frameworks: Spring Boot 4.1.0
**Information Checklist**
- [x] Bug Description Added
- [x] Repro Steps Added
- [x] Setup information Added
Contributor guide
Assessment
This issue has not been assessed yet.