Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Aug 14, 2025

Summary

This PR fixes an issue where the Save button in the Settings view does not become enabled when the user clicks the "Enable reasoning" checkbox.

Problem

When enableReasoningEffort is initially undefined and the user clicks the checkbox to enable it, the transition from undefined to true was incorrectly treated as an "initial sync" in the setApiConfigurationField function. This prevented the Save button from being enabled because the change was not detected.

Solution

The fix explicitly excludes enableReasoningEffort from the initial sync logic since it is a user-controlled checkbox that should always trigger changes when toggled.

Changes Made

  • Modified webview-ui/src/components/settings/SettingsView.tsx to exclude enableReasoningEffort from the initial sync condition

Testing

  • All existing tests pass
  • The Save button now correctly enables when clicking the "Enable reasoning" checkbox

Fixes #7099


Important

Fixes issue in SettingsView.tsx where the Save button does not enable when the "Enable reasoning" checkbox is clicked by excluding it from initial sync logic.

  • Behavior:
    • Fixes issue where Save button does not enable when "Enable reasoning" checkbox is clicked.
    • Excludes enableReasoningEffort from initial sync logic in setApiConfigurationField() in SettingsView.tsx.
  • Testing:
    • All existing tests pass.
    • Save button enables correctly when "Enable reasoning" checkbox is toggled.

This description was created by Ellipsis for 5d8e667. You can customize this summary. It will automatically update as commits are pushed.

…utton

When the user clicks the "Enable reasoning" checkbox, the Save button should
become enabled. Previously, the transition from undefined to true was treated
as an initial sync, preventing the button from enabling.

This fix explicitly excludes enableReasoningEffort from the initial sync logic
since it is a user-controlled checkbox that should always trigger changes.

Fixes #7099
@roomote roomote bot requested review from cte, jr and mrubens as code owners August 14, 2025 14:58
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Aug 14, 2025
@wjq990112
Copy link

This is not a robust solution, so I created a PR #7100 to fix it. Pls merge that PR first.

Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Reviewing my own code is like debugging in a mirror - everything looks backwards and I still can't find the problem.

const isInitialSync = previousValue === undefined && value !== undefined
// Exception: enableReasoningEffort is a user-controlled checkbox that should always trigger changes
const isInitialSync =
previousValue === undefined && value !== undefined && field !== "enableReasoningEffort"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

While this fix works for enableReasoningEffort, I found several other checkbox fields that might suffer from the same undefined → true transition issue:

  • anthropicBeta1MContext
  • awsBedrock1MContext
  • enableUrlContext
  • enableGrounding
  • lmStudioSpeculativeDecodingEnabled
  • openAiLegacyFormat

Should we investigate if these need the same treatment? Or perhaps consider a more scalable solution like maintaining a Set of user-controlled fields?

// This prevents the dirty state when the component initializes and auto-syncs the model ID
const isInitialSync = previousValue === undefined && value !== undefined
// Exception: enableReasoningEffort is a user-controlled checkbox that should always trigger changes
const isInitialSync =
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this approach intentional? Hard-coding field names here creates a maintenance burden. Could we consider using a more maintainable pattern like:

Suggested change
const isInitialSync =
// Don't treat initial sync from undefined to a defined value as a user change
// This prevents the dirty state when the component initializes and auto-syncs the model ID
// Exception: user-controlled checkboxes that should always trigger changes
const USER_CONTROLLED_FIELDS = new Set(['enableReasoningEffort'])
const isInitialSync =
previousValue === undefined && value !== undefined && !USER_CONTROLLED_FIELDS.has(field)

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 14, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 14, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Review] in Roo Code Roadmap Aug 14, 2025
@hannesrudolph hannesrudolph added PR - Needs Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Aug 14, 2025
@daniel-lxs
Copy link
Member

Fixed by #7113

@daniel-lxs daniel-lxs closed this Aug 16, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 16, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer PR - Needs Review size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Cannot enable "Save" button when the user click "Enable reasoning"

5 participants