Fix reasoning effort handling in Claude#312041
Merged
TylerLeonhardt merged 1 commit intomainfrom Apr 23, 2026
Merged
Conversation
The reasoning effort wasn't really getting passed down properly. This ensures that it does and if a model only has 1 reasoning value then we use that. Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Claude “reasoning effort” propagation for Claude SDK mode by resolving the requested effort against the selected endpoint’s supported effort levels, including a fallback behavior when the endpoint only supports a single effort level.
Changes:
- Add
resolveReasoningEfforttoClaudeCodeModelsand use it when committing session state from the VS Code chat session provider. - Pass resolved effort into the Claude agent SDK
Optionsand restart sessions when the effort level changes. - Update model picker configuration schema/tests to include reasoning effort even when only one level is supported, and add unit tests for the new resolution logic.
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/src/extension/chatSessions/vscode-node/claudeChatSessionContentProvider.ts | Resolve and persist reasoning effort per request using IClaudeCodeModels. |
| extensions/copilot/src/extension/chatSessions/claude/node/claudeCodeModels.ts | Introduce resolveReasoningEffort, accept parsed model IDs in resolveEndpoint, export isEffortLevel, and adjust configuration schema behavior. |
| extensions/copilot/src/extension/chatSessions/claude/node/claudeLanguageModelServer.ts | Gate reasoningEffort sent to the proxy request based on endpoint support. |
| extensions/copilot/src/extension/chatSessions/claude/node/claudeCodeAgent.ts | Track and pass SDK effort option; restart session when effort changes. |
| extensions/copilot/src/extension/chatSessions/claude/common/claudeSessionStateService.ts | Type session reasoningEffort as SDK EffortLevel. |
| extensions/copilot/src/extension/chatSessions/claude/node/claudeSessionStateService.ts | Update implementation to use EffortLevel for reasoning effort storage. |
| extensions/copilot/src/extension/chatSessions/claude/node/test/claudeCodeModels.spec.ts | Add/adjust tests for single-effort schema behavior, endpoint resolution, and resolveReasoningEffort/isEffortLevel. |
| extensions/copilot/src/extension/chatSessions/claude/node/test/claudeCodeAgent.spec.ts | Add tests asserting SDK options include effort and that sessions restart when effort changes. |
Copilot's findings
- Files reviewed: 8/8 changed files
- Comments generated: 2
Contributor
Screenshot ChangesBase: Changed (27) |
DonJayamanne
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The reasoning effort wasn't really getting passed down properly. This ensures that it does and if a model only has 1 reasoning value then we use that.
Fixes #311862
Co-authored-by: Copilot copilot@github.com