Fixes first-time initialization issue with Z AI and Doubao providers
where the API keys were not recognized as valid secret keys, causing
the configuration to fail during initial setup.
Fixes#7082
Co-authored-by: Roo Code <roomote@roocode.com>
* fix: prevent duplicate LM Studio models with case-insensitive deduplication
- Keep both listDownloadedModels and listLoaded APIs to support JIT loading
- Implement case-insensitive deduplication to prevent duplicates
- When duplicates are found, prefer loaded model data for accurate runtime info
- Add test coverage for deduplication logic
- Addresses feedback about LM Studio's JIT Model Loading feature (v0.3.5+)
Fixes#6954
* fix: correct deduplication logic to prefer loaded models
- When a loaded model ID is found in any downloaded model key (case-insensitive)
- Remove the downloaded model and replace with the loaded model
- This ensures loaded models with runtime info take precedence
- Updated tests to verify the correct deduplication behavior
* fix: improve deduplication logic and add comprehensive test coverage
- Enhanced deduplication to use path segment matching instead of simple substring
- Prevents false positives like 'llama' matching 'codellama'
- Added comprehensive test cases for edge cases and multiple scenarios
- Maintains support for JIT Model Loading feature
* feat: add support for OpenAI gpt-5-chat-latest model
- Added gpt-5-chat-latest model configuration to openAiNativeModels
- Updated OpenAiNativeHandler to recognize gpt-5-chat-latest as a Responses API model
- Added comprehensive tests for the new model
- Model is optimized for conversational AI and non-reasoning tasks
Fixes#7057
* fix: remove redundant condition and unnecessary test file
- Remove redundant gpt-5-chat-latest check in isResponsesApiModel since startsWith('gpt-5') already covers it
- Remove unnecessary dedicated test file for gpt-5-chat-latest
---------
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: daniel-lxs <ricciodaniel98@gmail.com>
* fix: add type check before calling .match() on diffItem.content
Fixes#6905 - Error during diff application "v.content.match is not a function"
- Added type check to ensure diffItem.content is a string before calling .match()
- Added comprehensive tests for handling non-string content values
- Prevents runtime errors when content is null, undefined, or other non-string types
* fix: validate content type earlier in diff parsing
- Move type check to where content is first extracted from XML
- Remove redundant check since content is now guaranteed to be string
- Add test for early content validation
* chore: remove comments
* fix: add TelemetryService mock to multiApplyDiffTool tests
* fix: add captureDiffApplicationError to TelemetryService mock
---------
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: daniel-lxs <ricciodaniel98@gmail.com>
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
* fix: enable save button for provider dropdown and checkbox changes
The save button wasn't enabling when users changed provider settings like
dropdowns and checkboxes because setApiConfigurationField was treating all
changes from undefined to a defined value as 'initial sync' and not marking
the form as dirty.
Added an optional isUserAction parameter (defaults to true) to distinguish:
- User actions (should enable save button) - the default
- Automatic initialization (shouldn't enable save button) - pass false
This fixes the issue where changing provider dropdowns, checkboxes with
default values, and other settings wouldn't enable the save button.
* fix: remove incorrect isUserAction=false from apiModelId sync
The useEffect that syncs apiModelId with selectedModelId was incorrectly
passing isUserAction=false, which prevented the save button from enabling
when users selected a different model. Since this effect responds to all
selectedModelId changes (including user selections), it should use the
default isUserAction=true behavior.
* test: fix ThinkingBudget test to expect isUserAction parameter
The test now correctly expects setApiConfigurationField to be called
with three arguments including the isUserAction=false parameter for
automatic thinking token adjustments.
* fix: prevent XML entity decoding in diff tools
- Add parseXmlForDiff function with processEntities: false to preserve exact content
- Update multiApplyDiffTool to use parseXmlForDiff instead of parseXml
- Add comprehensive tests for entity handling in parseXmlForDiff
This fixes the issue where fast-xml-parser was decoding HTML entities like &
causing mismatches in diff tools when comparing against original file content.
Fixes#7107
* refactor: eliminate code duplication between parseXml and parseXmlForDiff
- Refactored parseXml to accept optional ParseXmlOptions parameter
- parseXmlForDiff now delegates to parseXml with processEntities: false
- Added explanatory comment in multiApplyDiffTool.ts about why parseXmlForDiff is used
- Improved JSDoc documentation with specific use cases for parseXmlForDiff
This maintains backward compatibility while eliminating code duplication.
parseXml continues to be used for general XML parsing (file reads, follow-up questions),
while parseXmlForDiff is specifically for diff operations where entity processing must be disabled.
---------
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: daniel-lxs <ricciodaniel98@gmail.com>
Previously, when users initiated context condensing and switched to another task before completion, the 'condensing context' indicator would persist on the new task.
This fix ensures the condensing state is properly reset in the task switching effect, preventing the indicator from appearing incorrectly on different tasks.
- Removed array slicing logic that limited messages to 500
- This eliminates array index shifting that caused Virtuoso to lose scroll position
- Virtuoso is designed to efficiently handle large lists through virtualization
- Fixes the scrollbar jumping issue reported in #7063 and #7052
Co-authored-by: Roo Code <roomote@roocode.com>