* fix: resolve race condition in new_task delegation that loses parent task history
When delegateParentAndOpenChild creates a child task via createTask(), the
Task constructor fires startTask() as a fire-and-forget async call. The child
immediately begins its task loop and eventually calls saveClineMessages() →
updateTaskHistory(), which reads globalState, modifies it, and writes back.
Meanwhile, delegateParentAndOpenChild persists the parent's delegation
metadata (status: 'delegated', delegatedToId, awaitingChildId, childIds) via
a separate updateTaskHistory() call AFTER createTask() returns.
These two concurrent read-modify-write operations on globalState race: the
last writer wins, overwriting the other's changes. When the child's write
lands last, the parent's delegation fields are lost, making the parent task
unresumable when the child finishes.
Fix: create the child task with startTask: false, persist the parent's
delegation metadata first, then manually call child.start(). This ensures
the parent metadata is safely in globalState before the child begins writing.
* docs: clarify Task.start() only handles new tasks, not history resume
* refactor: remove 9 low-usage providers (Phase 0)
Remove Cerebras, Chutes, DeepInfra, Doubao, Featherless, Groq,
Hugging Face, IO Intelligence, and Unbound providers from the codebase.
Each provider removal includes: handler, tests, model definitions,
type schemas, UI settings components, fetchers, i18n references,
and all wiring in shared registration/config files.
- Delete 42 provider-specific files (handlers, tests, fetchers, UI components)
- Remove @ai-sdk/cerebras and @ai-sdk/groq npm dependencies
- Clean provider references from 68 shared files across src/, packages/types/,
webview-ui/, and apps/cli/
- Remove ~490 dead i18n translation keys across 36 locale files
- Add docs/ai-sdk-migration-guide.md with updated migration status
- All TypeScript checks pass, 6505 tests pass with 0 failures
* feat: show retired-provider message for removed provider profiles
Preserve API profiles that reference removed providers instead of
silently stripping their apiProvider. When a user selects a profile
configured for a retired provider, the settings UI now shows an
empathetic message explaining the removal instead of the provider
configuration form.
- Add retiredProviderNames array and isRetiredProvider() helper to
packages/types/src/provider-settings.ts
- Update ProviderSettingsManager sanitization to preserve retired
providers (only strip truly unknown values)
- Update ContextProxy sanitization to preserve retired providers
- Render retired-provider message in ApiOptions.tsx when selected
provider is in the retired list
- Add tests for sanitization, ContextProxy, and UI behavior
* feat: add retired-provider warning banner in chat view
* Revert "feat: add retired-provider warning banner in chat view"
This reverts commit dd593e1056.
* feat: show retired-provider message as inline chat response
* fix: show retired provider warning on home screen
Move WarningRow outside {task && ...} conditional so it renders
regardless of task state. Preserve user input on retired provider
intercept so text isn't lost when switching providers.
- Move showRetiredProviderWarning WarningRow to unconditional render
area near ProfileViolationWarning
- Remove setInputValue/setSelectedImages clearing from retired
provider early return in handleSendMessage
- Delete unused RetiredProviderWarning.tsx (dead code)
* fix: address PR review — passthrough retired-provider fields and i18n strings
- Use passthrough() in saveConfig() and load() so legacy provider-specific
fields (e.g. groqApiKey, deepInfraModelId) are preserved instead of
silently stripped by strict Zod parse()
- Move hardcoded English strings in ApiOptions.tsx and ChatView.tsx to
i18n translation keys (settings:providers.retiredProviderMessage,
chat:retiredProvider.{title,message,openSettings})
- Update tests to assert legacy provider-specific fields survive
save and load round-trips
* i18n: add retired-provider translations for all 17 locales
Translate providers.retiredProviderMessage (settings) and
retiredProvider.{title,message,openSettings} (chat) into ca, de, es,
fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, tr, vi, zh-CN, zh-TW.
* test: update ApiOptions retired-provider test to expect i18n key
* feat: add disabledTools setting to globally disable native tools
Add a disabledTools field to GlobalSettings that allows disabling specific
native tools by name. This enables cloud agents to be configured with
restricted tool access.
Schema:
- Add disabledTools: z.array(toolNamesSchema).optional() to globalSettingsSchema
- Add disabledTools to organizationDefaultSettingsSchema.pick()
- Add disabledTools to ExtensionState Pick type
Prompt generation (tool filtering):
- Add disabledTools to BuildToolsOptions interface
- Pass disabledTools through filterSettings to filterNativeToolsForMode()
- Remove disabled tools from allowedToolNames set in filterNativeToolsForMode()
Execution-time validation (safety net):
- Extract disabledTools from state in presentAssistantMessage
- Convert disabledTools to toolRequirements format for validateToolUse()
Wiring:
- Add disabledTools to ClineProvider getState() and getStateToPostToWebview()
- Pass disabledTools to all buildNativeToolsArrayWithRestrictions() call sites
EXT-778
* fix: check toolRequirements before ALWAYS_AVAILABLE_TOOLS
Moves the toolRequirements check before the ALWAYS_AVAILABLE_TOOLS
early-return in isToolAllowedForMode(). This ensures disabledTools
can block always-available tools (switch_mode, new_task, etc.) at
execution time, making the validation layer consistent with the
filtering layer.
* fix: capture and round-trip thinking signature for Bedrock Claude models
Bedrock handler streams reasoning text from Claude's extended thinking but
never captures the cryptographic signature. This causes 400 errors on
multi-turn conversations with tool use: 'Expected thinking or
redacted_thinking, but found tool_use'.
Changes:
- bedrock.ts: Capture reasoningContent.signature from Converse API stream
deltas, implement getThoughtSignature() so Task.ts stores it as a proper
thinking content block
- bedrock-converse-format.ts: Convert thinking blocks to Bedrock's
reasoningContent format with signature, skip reasoning/redacted_thinking/
thoughtSignature blocks that aren't valid for the API
* fix: add redacted_thinking round-trip, fix interface types, add tests
Address PR review feedback:
- Update ContentBlockDeltaEvent interface to include signature and
redactedContent fields (removes type assertions)
- Add 6 tests for thinking/reasoning block conversions in
bedrock-converse-format.ts
Also add redacted_thinking round-trip support:
- bedrock.ts: Capture redactedContent from stream deltas, base64 encode,
expose via getRedactedThinkingBlocks()
- Task.ts: Insert redacted_thinking blocks after thinking block in
assistant messages
- bedrock-converse-format.ts: Convert redacted_thinking blocks back to
reasoningContent.redactedContent (base64 → Uint8Array)
* refactor(task): append environment details into existing blocks
Add appendEnvironmentDetails() helper that merges environment details
into the last text block or tool_result instead of adding a standalone
trailing text block.
This avoids message shapes that can break interleaved-thinking models
like DeepSeek reasoner, which expect specific message structures.
Changes:
- Add appendEnvironmentDetails() and removeEnvironmentDetailsBlocks() helpers
- Update Task.resumeAfterDelegation() to use the helper
- Update Task.recursivelyMakeClineRequests() to use the helper
- Add comprehensive unit tests (26 test cases)
* fix: use named import for Anthropic SDK to match codebase convention
* fix(ai-sdk): preserve reasoning parts in message conversion
* fix(ai-sdk): convert message-level reasoning_content to reasoning part
* fix(task): remove invalid openai-compatible from reasoning allowlist
* feat: add isAiSdkProvider() method for dynamic AI SDK provider detection
- Add isAiSdkProvider() method to ApiHandler interface
- Default implementation in BaseProvider returns false
- Override to return true in 11 AI SDK providers:
deepseek, fireworks, mistral, groq, xai, cerebras,
sambanova, huggingface, gemini, vertex, openai-compatible
- Update Task.ts to use dynamic detection instead of hardcoded Set
- Add method to FakeAIHandler and update test mocks
* fix: handle reasoning parts in flattenAiSdkMessagesToStringContent
- Strip reasoning parts when flattening messages for string-only models
- Allow flattening when message contains only text and reasoning parts
- Add tests for reasoning part handling in string-only model contexts
This addresses the review feedback about ensuring flattenAiSdkMessagesToStringContent
works correctly when reasoning parts are present (e.g., SambaNova DeepSeek).
---------
Co-authored-by: daniel-lxs <ricciodaniel98@gmail.com>
* fix(ai-sdk): preserve reasoning parts in message conversion
* fix(ai-sdk): convert message-level reasoning_content to reasoning part
* fix(task): remove invalid openai-compatible from reasoning allowlist
* feat(condense): add smart code folding with tree-sitter signatures
At context condensation time, use tree-sitter to generate folded code
signatures (function definitions, class declarations) for files read
during the conversation. Each file is included as its own <system-reminder>
block in the condensed summary, preserving structural awareness without
consuming excessive tokens.
- Add getFilesReadByRoo() method to FileContextTracker
- Create generateFoldedFileContext() using tree-sitter parsing
- Update summarizeConversation() to accept array of file sections
- Each file gets its own content block in the summary message
- Add comprehensive test coverage (12 tests)
* fix: skip tree-sitter error strings in folded file context
- Add isTreeSitterErrorString helper to detect error messages
- Skip files that return error strings instead of embedding them
- Add test for error string handling
* refactor: move generateFoldedFileContext() inside summarizeConversation()
- Update summarizeConversation() to accept filesReadByRoo, cwd, rooIgnoreController instead of pre-generated sections
- Move folded file context generation inside summarizeConversation() (lines 319-339)
- Update ContextManagementOptions type and manageContext() to pass new parameters
- Remove generateFoldedFileContext from Task.ts imports - folding now handled internally
- Update all tests to use new parameter signature
- Reduces Task.ts complexity by moving folding logic to summarization module
* fix: prioritize most recently read files in folded context
Files are now sorted by roo_read_date descending before folded context
generation, so if the character budget runs out, the most relevant
(recently read) files are included and older files are skipped.
* refactor: improve code quality in condense module
- Convert summarizeConversation to use options object instead of 11 positional params
- Extract duplicated getFilesReadByRoo error handling into helper method
- Remove unnecessary re-export of generateFoldedFileContext
- Update all test files to use new options object pattern
* fix: address roomote feedback - batch error logging and early budget exit
---------
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: daniel-lxs <ricciodaniel98@gmail.com>
* fix: convert orphaned tool_results to text blocks after condensing
When condensing occurs after assistant sends tool_uses but before user responds,
the tool_use blocks get condensed away. User messages containing tool_results that
reference condensed tool_use_ids become orphaned and get filtered out by
getEffectiveApiHistory, causing user feedback to be lost.
This fix enhances the existing check in addToApiConversationHistory to detect when
the previous effective message is not an assistant and converts any tool_result
blocks to text blocks, preventing them from being filtered as orphans.
The conversion happens at the latest possible moment (message insertion) because:
- Tool results are created before we know if condensing will occur
- We need actual effective history state to make the decision
- This is the last checkpoint before orphan filtering happens
* Only include environment details in summary for automatic condensing
For automatic condensing (during attemptApiRequest), environment details
are included in the summary because the API request is already in progress
and the next user message won't have fresh environment details injected.
For manual condensing (via condenseContext button), environment details
are NOT included because fresh details will be injected on the very next
turn via getEnvironmentDetails() in recursivelyMakeClineRequests().
This uses the existing isAutomaticTrigger flag to differentiate behavior.
---------
Co-authored-by: Hannes Rudolph <hrudolph@gmail.com>
* chore: remove MULTI_FILE_APPLY_DIFF experiment
Remove the 'Enable concurrent file edits' experimental feature that
allowed editing multiple files in a single apply_diff call.
- Remove multiFileApplyDiff from experiment types and config
- Delete MultiFileSearchReplaceDiffStrategy class and tests
- Delete MultiApplyDiffTool wrapper and tests
- Remove experiment-specific code paths in Task.ts, generateSystemPrompt.ts, and presentAssistantMessage.ts
- Remove special handling in ExperimentalSettings.tsx
- Remove translations from all 18 locale files
The existing MultiSearchReplaceDiffStrategy continues to handle
multiple SEARCH/REPLACE blocks within a single file.
* fix: remove unused EXPERIMENT_IDS/experiments import from Task.ts
Addresses review feedback: removes the unused imports from
src/core/task/Task.ts that were left over after removing the
MULTI_FILE_APPLY_DIFF experiment routing code.
* fix(condense): remove custom condensing model option
Remove the ability to specify a different model/API configuration for
condensing conversations. Modern conversations include provider-specific
data (tool calls, reasoning blocks, thought signatures) that only the
originating model can properly understand and summarize.
Changes:
- Remove condensingApiHandler parameter from summarizeConversation()
- Remove condensingApiConfigId from context management and Task
- Remove API config dropdown for CONDENSE in settings UI
- Update telemetry to remove usedCustomApiHandler parameter
- Update related tests
Users can still customize the CONDENSE prompt text; only model selection
is removed.
* fix: remove condensingApiConfigId from types and test fixtures
---------
Co-authored-by: Roo Code <roomote@roocode.com>
* feat: warn users when too many MCP tools are enabled
- Add WarningRow component for displaying generic warnings with icon, title, message, and optional docs link
- Add TooManyToolsWarning component that shows when users have more than 40 MCP tools enabled
- Add MAX_MCP_TOOLS_THRESHOLD constant (40)
- Add i18n translations for the warning message
- Integrate warning into ChatView to display after task header
- Add comprehensive tests for both components
Closes ROO-542
* Moves constant to the right place
* Move it to the backend
* i18n
* Add actionlink that takes you to MCP settings in this case
* Add to MCP settings too
* Bump max tools up to 60 since github itself has 50+
* DRY
* Fix test
---------
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: Bruno Bergher <bruno@roocode.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>