Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Feb 9, 2026

Related GitHub Issue

Closes: #8230

Description

Picks up the fix from #11300 by @robertjmcintyre (without the unrelated Windows test changes).

Root Cause

Automatic header synchronization in the OpenAI Compatible provider settings causes a false dirty state. 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 fix this issue:

  1. ApiOptions.tsx — Mark debounced header sync as non-user action (isUserAction: false)
  2. OpenAICompatible.tsx — Mark timeout header sync as non-user action (and update type definition)
  3. SettingsView.tsx — Enhanced change detection logic to skip automatic syncs with semantically equal values (areValuesEqual helper)

Credit

Original fix by @robertjmcintyre in #11300.

Test Procedure

All existing tests pass (300 webview-ui settings tests, 5314 roo-cline tests).

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue.
  • Scope: Changes are focused on the linked issue only.
  • Self-Review: Performed a thorough self-review.
  • Testing: All existing tests pass.
  • Contribution Guidelines: Read and agreed to the Contributor Guidelines.

Important

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

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

Mark automatic header syncs in ApiOptions and OpenAICompatible as
non-user actions (isUserAction: false) and enhance SettingsView change
detection to skip automatic syncs with semantically equal values.

Root cause: two components (ApiOptions and OpenAICompatible) manage
openAiHeaders state and automatically sync it back on mount/remount.
These syncs were treated as user changes, triggering a false dirty state.

Co-authored-by: Robert McIntyre <robertjmcintyre@users.noreply.github.com>
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Feb 9, 2026
@roomote
Copy link
Contributor

roomote bot commented Feb 9, 2026

Rooviewer Clock   See task

No issues found. The fix correctly addresses the root cause by marking automatic header syncs as non-user actions and adding semantic equality checking in the change detection logic.

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

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 9, 2026
@daniel-lxs daniel-lxs merged commit 2b72a58 into main Feb 9, 2026
18 checks passed
@daniel-lxs daniel-lxs deleted the fix/settings-unsaved-changes-openai-headers branch February 9, 2026 17:40
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Feb 9, 2026
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 size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Unsaved-changes prompt after Mode/API change without edits

2 participants