Fixes unsaved changes prompt on unchanged settings (#8230).#11300
Open
robertjmcintyre wants to merge 1 commit intoRooCodeInc:mainfrom
Open
Fixes unsaved changes prompt on unchanged settings (#8230).#11300robertjmcintyre wants to merge 1 commit intoRooCodeInc:mainfrom
robertjmcintyre wants to merge 1 commit intoRooCodeInc:mainfrom
Conversation
Contributor
Review complete. No issues found. The fix correctly addresses the root cause: automatic header syncs in Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
Collaborator
|
@roomote fix failing tests |
Contributor
Fixed the failing CI checks by merging |
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.
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 (
ApiOptionsandOpenAICompatible) manageopenAiHeadersstate and automatically sync it back to the configuration. When components mount/remount:customHeadersstate initializes with a new array/object reference (even if content is identical)setApiConfigurationField("openAiHeaders", ...)without marking them as non-user actionsSolution
Three changes are required to fix this issue:
Without all three changes, the bug would persist because:
isUserAction: false, syncing{}→{}would trigger change detection since they have different object referencesTest 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
Fixed Behavior
Pre-Submission Checklist
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.
ApiOptions.tsxandOpenAICompatible.tsx.SettingsView.tsxto skip automatic syncs with semantically equal values.setApiConfigurationFieldinApiOptions.tsxandOpenAICompatible.tsxto includeisUserActionparameter.areValuesEqualhelper inSettingsView.tsxfor deep comparison of objects/arrays.This description was created by
for cc47997. You can customize this summary. It will automatically update as commits are pushed.