Skip to content

remove temperature - #1421

Merged
iceljc merged 1 commit into
SciSharp:masterfrom
iceljc:feature/rule-engine-parallel-execution
Sep 3, 2026
Merged

remove temperature#1421
iceljc merged 1 commit into
SciSharp:masterfrom
iceljc:feature/rule-engine-parallel-execution

Conversation

@iceljc

@iceljc iceljc commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@iceljc
iceljc merged commit d1edd23 into SciSharp:master Sep 3, 2026
0 of 4 checks passed
@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Stop setting temperature for OpenAI Responses requests

🐞 Bug fix 🕐 Less than 10 minutes

Grey Divider

AI Description

• Stops sending temperature through OpenAI Responses API requests.
• Preserves token and reasoning settings while using model-default sampling behavior.
Diagram

graph TD
    A["Agent request"] --> B["Response options"] --> C["Responses client"] --> D["OpenAI Responses"]
    E["Token state"] --> B
    F["Reasoning settings"] --> B
Loading
High-Level Assessment

Removing temperature from the Responses-specific options builder is the most targeted approach because it avoids unsupported or model-sensitive parameter combinations while preserving temperature behavior in the separate Chat Completions path. Conditional removal only for reasoning modes was considered but would retain compatibility risk for other Responses models.

Files changed (1) +0 / -7

Bug fix (1) +0 / -7
ChatCompletionProvider.Response.csRemove temperature from Responses API options +0/-7

Remove temperature from Responses API options

• Removes temperature state parsing and assignment when constructing 'CreateResponseOptions'. Also removes the now-unnecessary reasoning-specific temperature reset, allowing Responses models to use their default sampling configuration.

src/Plugins/BotSharp.Plugin.OpenAI/Providers/Chat/ChatCompletionProvider.Response.cs

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Responses ignore requested temperature 🐞 Bug ≡ Correctness
Description
Removing CreateResponseOptions.Temperature makes the Responses API ignore the documented
MessageConfig.Temperature value stored by the conversation controller. Because UseResponseApi is
enabled by default in WebStarter, callers can request a sampling temperature but receive output
generated with the provider default instead.
Code

src/Plugins/BotSharp.Plugin.OpenAI/Providers/Chat/ChatCompletionProvider.Response.cs[448]

-            Temperature = temperature,
Evidence
The public request model documents temperature as a generation control, and the conversation
controller stores it under the exact temperature state key. OpenAI requests are routed through the
Responses implementation when UseResponseApi is enabled—which WebStarter enables by default—but
the changed options construction now only sets max tokens and reasoning options; the sibling Chat
Completions implementation still reads and applies temperature.

src/Infrastructure/BotSharp.Abstraction/Models/MessageConfig.cs[23-26]
src/Infrastructure/BotSharp.OpenAPI/Controllers/Conversation/ConversationController.cs[538-540]
src/Plugins/BotSharp.Plugin.OpenAI/Providers/Chat/ChatCompletionProvider.cs[37-46]
src/WebStarter/appsettings.json[44-46]
src/Plugins/BotSharp.Plugin.OpenAI/Providers/Chat/ChatCompletionProvider.Response.cs[441-459]
src/Plugins/BotSharp.Plugin.OpenAI/Providers/Chat/ChatCompletionProvider.Chat.cs[612-639]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Responses API path no longer propagates the caller's temperature, so the public temperature control is silently ignored and generation uses the provider default.

## Issue Context
`MessageConfig.Temperature` is documented as controlling completion creativity and is stored in conversation state. WebStarter enables the Responses API by default, while the sibling Chat Completions path still reads and applies the same state. Preserve temperature for compatible non-reasoning requests while omitting it only for models/options that reject it.

## Fix Focus Areas
- src/Plugins/BotSharp.Plugin.OpenAI/Providers/Chat/ChatCompletionProvider.Response.cs[441-459]
- src/Plugins/BotSharp.Plugin.OpenAI/Providers/Chat/ChatCompletionProvider.Chat.cs[612-639]
- src/Infrastructure/BotSharp.Abstraction/Models/MessageConfig.cs[23-26]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: ⚖️ Balanced

Grey Divider

Tip of the day
💡 Did you know, you can add REVIEW.md to your repo root and Qodo follows it on every PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo


var options = new CreateResponseOptions(_model, [])
{
Temperature = temperature,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Responses ignore requested temperature 🐞 Bug ≡ Correctness

Removing CreateResponseOptions.Temperature makes the Responses API ignore the documented
MessageConfig.Temperature value stored by the conversation controller. Because UseResponseApi is
enabled by default in WebStarter, callers can request a sampling temperature but receive output
generated with the provider default instead.
Agent Prompt
## Issue description
The Responses API path no longer propagates the caller's temperature, so the public temperature control is silently ignored and generation uses the provider default.

## Issue Context
`MessageConfig.Temperature` is documented as controlling completion creativity and is stored in conversation state. WebStarter enables the Responses API by default, while the sibling Chat Completions path still reads and applies the same state. Preserve temperature for compatible non-reasoning requests while omitting it only for models/options that reject it.

## Fix Focus Areas
- src/Plugins/BotSharp.Plugin.OpenAI/Providers/Chat/ChatCompletionProvider.Response.cs[441-459]
- src/Plugins/BotSharp.Plugin.OpenAI/Providers/Chat/ChatCompletionProvider.Chat.cs[612-639]
- src/Infrastructure/BotSharp.Abstraction/Models/MessageConfig.cs[23-26]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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