Skip to content

Fixes unsaved changes prompt on unchanged settings (#8230).#11300

Open
robertjmcintyre wants to merge 1 commit intoRooCodeInc:mainfrom
robertjmcintyre:bugfix/settingssave
Open

Fixes unsaved changes prompt on unchanged settings (#8230).#11300
robertjmcintyre wants to merge 1 commit intoRooCodeInc:mainfrom
robertjmcintyre:bugfix/settingssave

Conversation

@robertjmcintyre
Copy link

@robertjmcintyre robertjmcintyre commented Feb 8, 2026

Related GitHub Issue

Closes: # #8230

Roo Code Task Context (Optional)

N/A

Description

Root Cause

The issue is caused by automatic header synchronization in the OpenAI Compatible provider settings. Two separate components (ApiOptions and OpenAICompatible) manage openAiHeaders state and automatically sync it back to the configuration. When components mount/remount:

  1. customHeaders state initializes with a new array/object reference (even if content is identical)
  2. Debounced/timeout effects fire after 300ms to sync headers
  3. These effects call setApiConfigurationField("openAiHeaders", ...) without marking them as non-user actions
  4. The change detection logic treats these automatic syncs as user changes

Solution

Three changes are required to fix this issue:

  1. ApiOptions.tsx - Mark debounced header sync as non-user action
  2. OpenAICompatible.tsx - Mark timeout header sync as non-user action (and associated type definition update)
  3. SettingsView.tsx - Enhanced change detection logic

Without all three changes, the bug would persist because:

  • Without (1) or (2): Headers would still be marked as user actions
  • Without (3): Even with isUserAction: false, syncing {}{} would trigger change detection since they have different object references

Test Procedure

Unit Tests - All active unit tests passing

@roo-code/build:test: Test Files 1 passed (1)
@roo-code/build:test: Tests 1 passed (1)
@roo-code/vscode-shim:test: Test Files 22 passed (22)
@roo-code/vscode-shim:test: Tests 407 passed (407)
@roo-code/telemetry:test: Test Files 1 passed (1)
@roo-code/telemetry:test: Tests 31 passed (31)
@roo-code/types:test: Test Files 9 passed (9)
@roo-code/types:test: Tests 166 passed (166)
@roo-code/cloud:test: Test Files 14 passed (14)
@roo-code/cloud:test: Tests 270 passed (270)
@roo-code/cli:test: Test Files 24 passed | 1 skipped (25)
@roo-code/cli:test: Tests 399 passed | 1 skipped (400)
@roo-code/vscode-webview:test: Test Files 118 passed (118)
@roo-code/vscode-webview:test: Tests 1245 passed | 8 skipped (1253)
@roo-code/core:test: Test Files 9 passed (9)
@roo-code/core:test: Tests 140 passed (140)
roo-cline:test: Test Files 368 passed | 4 skipped (372)
roo-cline:test: Tests 5340 passed | 47 skipped (5387)

Manual Testing

NOTE: This only happens with the OpenAI Compatible API Provider selected.

Current Behavior

  1. Open Settings dialog, note the Save button is active shortly after opening, before any changes
  2. Close Settings dialog (back arrow or Done), see Discard Changes dialog open
  3. Repeat (1), click Save
  4. Navigate to any other tab (About Roo Code, etc.), note Save button remains inactive
  5. Navigate back to Providers tab, note Save button immediately becomes active again, without any changes

Fixed Behavior

  1. Open Settings dialog, note the Save button remains inactive
  2. Navigate to any other tab (About Roo Code, etc.), note Save button remains inactive
  3. Navigate back to Providers tab, note Save button remains inactive
  4. Make a change to a setting on the Providers tab, note Save button becomes active
  5. Close Settings dialog (back arrow or Done), see Discard Changes dialog open

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • N/A Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

None

Documentation Updates

Additional Notes

Again, this only happens in the OpenAI Compatible API Provider case.

Get in Touch

AbsenceOfSound


Important

Fixes unsaved changes prompt in settings by marking automatic header syncs as non-user actions and enhancing change detection logic.

  • Behavior:
    • Fixes unsaved changes prompt in settings by marking automatic header syncs as non-user actions in ApiOptions.tsx and OpenAICompatible.tsx.
    • Enhances change detection logic in SettingsView.tsx to skip automatic syncs with semantically equal values.
  • Functions:
    • Updates setApiConfigurationField in ApiOptions.tsx and OpenAICompatible.tsx to include isUserAction parameter.
    • Adds areValuesEqual helper in SettingsView.tsx for deep comparison of objects/arrays.
  • Misc:
    • Adjusts timeout and debounce logic to ensure proper synchronization without triggering false change detection.

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

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Feb 8, 2026
@roomote
Copy link
Contributor

roomote bot commented Feb 8, 2026

Rooviewer Clock   See task

Review complete. No issues found. The fix correctly addresses the root cause: automatic header syncs in ApiOptions and OpenAICompatible were triggering false change detection. The three-part solution (marking syncs as non-user actions, adding semantic equality checks, updating the type signature) is well-targeted and minimal.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph
Copy link
Collaborator

@roomote fix failing tests

@roomote
Copy link
Contributor

roomote bot commented Feb 8, 2026

Fixaroo Clock   See task

Fixed the failing CI checks by merging main into the branch to resolve a broken lockfile (ERR_PNPM_LOCKFILE_MISSING_DEPENDENCY for @ai-sdk/provider@2.0.1). All type checks (14/14) and webview-ui tests (119 files, 1227 tests) pass.

View commit | Revert commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants