Revise reasoning effort values in OpenAIPromptExecutionSettings - #14285
Revise reasoning effort values in OpenAIPromptExecutionSettings#14285Rui Hiraoka (rui-hira) wants to merge 1 commit into
Conversation
Updated the documentation for reasoning effort values to include 'none' and 'xhigh'.
There was a problem hiding this comment.
Pull request overview
Updates the .NET OpenAI connector’s execution settings documentation to expand the documented reasoning_effort values, aiming to reflect newer model/API capabilities.
Changes:
- Updated
OpenAIPromptExecutionSettings.ReasoningEffortXML remarks to include additional string values ("none","xhigh").
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| /// Constrains effort on reasoning for reasoning models. | ||
| /// Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. | ||
| /// Possible values are: | ||
| /// <para>- <see cref="string"/> values: <c>"low"</c>, <c>"medium"</c>, <c>"high"</c>, <c>"minimal"</c>;</para> | ||
| /// <para>- <see cref="string"/> values: <c>"none"</c>, <c>"minimal"</c>, <c>"low"</c>, <c>"medium"</c>, <c>"high"</c>, <c>"xhigh"</c>;</para> | ||
| /// <para>- <see cref="ChatReasoningEffortLevel"/> object;</para> |
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: Findings reported
Scope: full PR (1 commit(s)): ccfd59be36f0
Model: claude-opus-4.8
Overview
This PR revises a single XML-doc line to broaden the documented set of reasoning_effort string values, adding "none" and "xhigh". No executable code, serialization, or API signature changed, so there is no runtime regression and no security impact. However, the changed line now lists these values under <see cref="string"/> values, while the sole string consumer (GetEffortLevel) accepts only low/medium/high/minimal and throws NotSupportedException for anything else — creating a doc-vs-runtime contract mismatch that can steer callers into a request-time exception.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
1 verified finding remained after source verification (1 medium) across 1 file. Details are attached to the affected lines below.
Affected areas: dotnet/src/Connectors/Connectors.OpenAI/Settings/OpenAIPromptExecutionSettings.cs
| /// Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. | ||
| /// Possible values are: | ||
| /// <para>- <see cref="string"/> values: <c>"low"</c>, <c>"medium"</c>, <c>"high"</c>, <c>"minimal"</c>;</para> | ||
| /// <para>- <see cref="string"/> values: <c>"none"</c>, <c>"minimal"</c>, <c>"low"</c>, <c>"medium"</c>, <c>"high"</c>, <c>"xhigh"</c>;</para> |
There was a problem hiding this comment.
This line now documents "none" and "xhigh" as accepted string values, but the string-handling path in GetEffortLevel (ClientCore.ChatCompletion.cs:568-578) maps only "low", "medium", "high", and "minimal" and throws NotSupportedException for any other string. A caller who follows this doc and sets ReasoningEffort = "none" (or "xhigh") will get a runtime NotSupportedException when the request is built (same path for OpenAI and Azure OpenAI via AzureClientCore.ChatCompletion.cs:56). Please either restrict the documented string list to the values the switch actually accepts ("minimal", "low", "medium", "high") and note that extended values such as "none"/"xhigh" must be passed via a ChatReasoningEffortLevel object, or extend GetEffortLevel to accept "none"/"xhigh" so the code matches the documented contract.
|
Need to revise this validation to include current parameters so please do not merge this before the validator is fixed. |
Updated the documentation for reasoning effort values to include 'none' and 'xhigh'.
Motivation and Context
The
reasoning_effortvalues currently documented for the GPT-5 series includenone,minimal,low,medium,high,xhigh, andmax, with support varying by model. The current remarks list onlylow,medium,high, andminimal, so callers have no indication thatnone(and others) are valid.nonein particular is not a niche value — it is required for some Chat Completions scenarios on newer models.Description
This property is object and REST level, none and xhigh are also available.

https://learn.microsoft.com/en-us/rest/api/microsoft-foundry/azureopenai/chat?view=rest-microsoft-foundry-v1#openaireasoningeffort
Contribution Checklist