Commit graph

250 commits

Author SHA1 Message Date
Hannes Rudolph
fa9dff4a06
refactor: remove browser use functionality entirely (#11392) 2026-02-11 18:11:21 -07:00
Chris Estreich
77b76a891f
Handle cancel/resume abort races without crashing (#11422) 2026-02-11 15:55:08 -08:00
Daniel
e6f0e79c38
feat: implement ModelMessage storage layer with AI SDK response messages (#11409)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-11 13:58:39 -05:00
Matt Rubens
dcb33c47ad
Revert "feat: wire RooMessage storage into Task.ts and all providers" (#11394) 2026-02-10 23:57:42 -05:00
Daniel
a7ba3b5af5
feat: wire RooMessage storage into Task.ts and all providers (#11386) 2026-02-10 21:25:48 -07:00
Hannes Rudolph
8a69e9e04d
feat: rename search_and_replace tool to edit and unify edit-family UI (#11296) 2026-02-10 17:32:35 -07:00
Hannes Rudolph
2f9849071d
fix: surface actual API error messages instead of generic NoOutputGeneratedError (#11359) 2026-02-09 19:47:04 -07:00
Daniel
7c58f29975
fix: resolve race condition in new_task delegation that loses parent task history (#11331)
* 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
2026-02-09 13:13:04 -07:00
Hannes Rudolph
ef2fec9a23
refactor: remove 9 low-usage providers and add retired-provider UX (#11297)
* 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
2026-02-09 09:40:59 -07:00
Hannes Rudolph
6826e20da2
fix: prevent parent task state loss during orchestrator delegation (#11281) 2026-02-07 15:24:54 -07:00
Daniel
6d2459c7e8
feat: add disabledTools setting to globally disable native tools (#11277)
* 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.
2026-02-06 15:51:18 -08:00
Matt Rubens
dd6e32eb18
Revert "refactor(task): append environment details into existing blocks" (#11256)
Revert "refactor(task): append environment details into existing blocks (#11198)"

This reverts commit b0dc6ae918.
2026-02-06 11:22:38 -05:00
Hannes Rudolph
87f6d908c6
fix: capture and round-trip thinking signature for Bedrock Claude (#11238)
* 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)
2026-02-05 17:53:00 -08:00
Hannes Rudolph
b0dc6ae918
refactor(task): append environment details into existing blocks (#11198)
* 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
2026-02-05 12:33:00 -08:00
Hannes Rudolph
1b75d59a68
fix(ai-sdk): preserve reasoning parts in message conversion (#11217)
* 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>
2026-02-05 10:48:21 -07:00
Matt Rubens
934f34ea87
Revert "fix(ai-sdk): preserve reasoning parts in message conversion" (#11216)
Revert "fix(ai-sdk): preserve reasoning parts in message conversion (#11196)"

This reverts commit 227b9796d3.
2026-02-05 07:40:36 -08:00
Hannes Rudolph
227b9796d3
fix(ai-sdk): preserve reasoning parts in message conversion (#11196)
* 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
2026-02-04 22:00:11 -08:00
Chris Estreich
e5fa5e8e46
IPC fixes for task cancellation and queued messages (#11162) 2026-02-02 11:13:56 -08:00
Hannes Rudolph
cc86049f10
refactor(read_file): Codex-inspired read_file refactor EXT-617 (#10981) 2026-01-29 15:16:32 -07:00
Daniel
4b1d78fe0a
feat: migrate DeepSeek to @ai-sdk/deepseek + fix AI SDK tool streaming (#11079) 2026-01-29 15:56:51 -05:00
Hannes Rudolph
f848795775
refactor: replace fetch_instructions with skill tool and built-in skills (#11084)
Co-authored-by: Roo Code <roomote@roocode.com>
2026-01-29 12:47:36 -07:00
Hannes Rudolph
0c53f1937a
Revert "refactor: replace fetch_instructions with skill tool and built-in skills" (#11083) 2026-01-29 11:46:58 -07:00
Hannes Rudolph
67e568f6bb
refactor: replace fetch_instructions with skill tool and built-in skills (#10913) 2026-01-29 07:48:08 -07:00
Daniel
ed35b09aad
Enable parallel tool calls by default (#11031) 2026-01-29 01:29:15 -05:00
Daniel
f5004ac40a
fix: prevent time-travel bug in parallel tool calling (#11046) 2026-01-28 13:25:02 -05:00
Hannes Rudolph
e7965d9b45
feat: lossless terminal output with on-demand retrieval (#10944) 2026-01-27 22:12:19 -07:00
Hannes Rudolph
d748de6fae
feat(condense v2.1): add smart code folding (#10942)
* 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>
2026-01-27 18:47:24 -05:00
Matt Rubens
dc5e765e9c
Revert "Revert "Enable parallel tool calling with new_task isolation safeguards"" (#11006) 2026-01-27 10:31:03 -05:00
Matt Rubens
5b3626f1a6
Revert "Enable parallel tool calling with new_task isolation safeguards" (#11004) 2026-01-27 10:20:12 -05:00
Daniel
2584504b9b
Enable parallel tool calling with new_task isolation safeguards (#10979)
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
Co-authored-by: Hannes Rudolph <hrudolph@gmail.com>
2026-01-27 00:26:49 -05:00
Hannes Rudolph
bd29766406
fix: record truncation event when condensation fails but truncation succeeds (#10984) 2026-01-26 17:19:27 -07:00
Daniel
339f5aad48
fix: convert orphaned tool_results to text blocks after condensing (#10927)
* 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>
2026-01-23 19:04:36 -05:00
Hannes Rudolph
526488e5b6
chore: remove MULTI_FILE_APPLY_DIFF experiment (#10925)
* 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.
2026-01-23 18:39:24 -05:00
Hannes Rudolph
85f42dca83
chore: remove diffEnabled and fuzzyMatchThreshold settings (#10298) 2026-01-23 16:39:08 -05:00
Hannes Rudolph
0ff826d21d
feat(condense): improve condensation with environment details, accurate token counts, and lazy evaluation (#10920) 2026-01-23 13:52:47 -07:00
Hannes Rudolph
cf5d42e1e1
Intelligent Context Condensation v2 (#10873) 2026-01-23 12:33:35 -07:00
Hannes Rudolph
9d65772d24
fix(condense): remove custom condensing model option (#10901)
* 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>
2026-01-22 20:06:04 -05:00
Hannes Rudolph
be0e8c2665
chore: clean up XML legacy code and native-only comments (#10900) 2026-01-22 15:56:11 -05:00
Chris Estreich
13e090ef81
fix: prevent task abortion when resuming via IPC/bridge (#10892) 2026-01-22 02:31:51 -08:00
Hannes Rudolph
3f332d8e2b
refactor: migrate context condensing prompt to customSupportPrompts and cleanup legacy code (#10881) 2026-01-21 21:33:46 -05:00
Hannes Rudolph
8de9337e63
chore: remove XML tool calling support (#10841)
Co-authored-by: daniel-lxs <ricciodaniel98@gmail.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2026-01-20 20:25:08 -05:00
Hannes Rudolph
06039400cd
perf(webview): avoid resending taskHistory in state updates (#10842)
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
2026-01-19 21:22:32 -07:00
roomote[bot]
0f08867656
refactor: unify user content tags to <user_message> (#10723)
Co-authored-by: Roo Code <roomote@roocode.com>
2026-01-18 22:04:00 -05:00
roomote[bot]
a148862a06
feat: warn users when too many MCP tools are enabled (#10772)
* 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>
2026-01-18 09:22:09 -05:00
Daniel
bbb6a6e4b4
fix: prevent duplicate tool_use IDs causing API 400 errors (#10760) 2026-01-15 23:08:21 -05:00
Hannes Rudolph
4ebbca08b0
feat: add OpenAI Codex provider with OAuth subscription authentication (#10736)
Co-authored-by: Roo Code <roomote@roocode.com>
2026-01-14 23:48:51 -05:00
Hannes Rudolph
9b1c8500d9
feat(gemini): add allowedFunctionNames support to prevent mode switch errors (#10708)
Co-authored-by: Roo Code <roomote@roocode.com>
2026-01-13 23:49:57 -05:00
Daniel
621d9500de
fix: sanitize tool_use IDs to match API validation pattern (#10649) 2026-01-12 18:04:58 -05:00
Hannes Rudolph
e39abbffa1
fix: make edit_file matching more resilient (#10585) 2026-01-09 20:32:13 -05:00
Hannes Rudolph
168cfcaba5
fix: round-trip Gemini thought signatures for tool calls (#10590) 2026-01-09 20:03:58 -05:00