Hot-swap effort level on Claude session via applyFlagSettings#314295
Merged
TylerLeonhardt merged 1 commit intomainfrom May 5, 2026
Merged
Hot-swap effort level on Claude session via applyFlagSettings#314295TylerLeonhardt merged 1 commit intomainfrom
TylerLeonhardt merged 1 commit intomainfrom
Conversation
Use the SDK's applyFlagSettings({ effortLevel }) to update reasoning
effort on an active Claude session, matching the model and permission-mode
hot-swap pattern. This avoids the previous workaround of restarting the
session whenever the user changed effort level.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
roblourens
approved these changes
May 5, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Claude chat session implementation so reasoning effort can be changed on an active SDK session via applyFlagSettings, aligning effort changes with the existing hot-swap behavior for model and permission mode instead of forcing a session restart.
Changes:
- Added
_setEffort()inClaudeCodeSessionand wired effort changes into the active-session hot-swap path. - Removed effort-level changes from the restart conditions so only non-hot-swappable changes (such as MCP tool changes) restart the session.
- Extended the Claude SDK mock and updated session tests to assert
applyFlagSettingsusage instead of creating a new query.
Show a summary per file
| File | Description |
|---|---|
extensions/copilot/src/extension/chatSessions/claude/node/claudeCodeAgent.ts |
Adds effort hot-swap support on active Claude sessions and updates restart logic/comments. |
extensions/copilot/src/extension/chatSessions/claude/node/test/mockClaudeCodeSdkService.ts |
Extends the test mock to record applyFlagSettings calls and payloads. |
extensions/copilot/src/extension/chatSessions/claude/node/test/claudeCodeAgent.spec.ts |
Updates session tests to verify effort hot-swap behavior instead of restart behavior. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 1
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.
Use the SDK's
applyFlagSettings({ effortLevel })to update reasoning effort on an active Claude session, matching the model and permission-mode hot-swap pattern. This avoids the previous workaround of restarting the session whenever the user changed effort level.Changes
claudeCodeAgent.ts: added_setEffort()mirroring_setModel()/_setPermissionMode(), and removed theeffort !== _currentEffortrestart trigger from_createPromptIterable. Effort is now hot-swapped alongside model and permission mode.mockClaudeCodeSdkService.ts: addedapplyFlagSettingsmock withapplyFlagSettingsCallCount/lastAppliedFlagSettingstracking.claudeCodeAgent.spec.ts: updated effort tests to assert hot-swap (no new query,applyFlagSettingsinvoked) instead of session restart.