* Add reasoning budget support to Bedrock models and update related components
- Introduced `supportsReasoningBudget` property in Bedrock models.
- Enhanced `AwsBedrockHandler` to handle reasoning budget in payloads.
- Updated `ThinkingBudget` component to dynamically set max tokens based on reasoning support.
- Modified `ApiOptions` and `Bedrock` components to conditionally render `ThinkingBudget`.
- Added tests for extended thinking functionality in `bedrock-reasoning.test.ts`.
* Add BedrockThinkingConfig interface and update payload structure
* fix: address PR review feedback (#4481)
- Simplify ThinkingBudget ternary logic since component only renders when reasoning budget supported
- Break down complex thinking enabled condition with clear documentation
- Replace 'as any' usage with proper TypeScript interfaces for AWS SDK events
- Add comprehensive documentation for multiple stream structures explaining AWS SDK compatibility
* feat: show ThinkingBudget component unconditionally
Remove selectedProviderModels.length check to display ThinkingBudget
for all providers, not just those with available models
---------
Co-authored-by: hannesrudolph <hrudolph@gmail.com>
* feat: add `injectVariables()`, support magic variables for MCPs
* fix: fallback for `workspaceFolder` should just be an empty string
Previously this is intended so that the CLI receives a correct empty path argument, but on a second thought, if the user have added the quotes themselves it might cause error.
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* chore: remove unused import
* chore: better log format
* chore: better describe the accepted config type and more extensive test
---------
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* Manually specify openai-compat format and parse it
* fixup! Manually specify openai-compat format and parse it
* Expect base64 in embedding test arguments
* fixup! Manually specify openai-compat format and parse it
Remove debug logs
* fixup! Manually specify openai-compat format and parse it
Improve comment
* fixup! Manually specify openai-compat format and parse it
* Add tests to exercise base64 decode of embeddings
* Add tests to verify openai base64 and brokenness behavior
* feat: improve typing
* refactor: switch from jest to vitest for mocking in tests
---------
Co-authored-by: Dixie Flatline <dflatline>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
* add mermaid buttons
* feat: Add Modal, TabButton, and ZoomControls components
* feat: Add error handling messages for image operations and file opening
* mermaid: Add drag functionality and support contious zooming
* add active color for tabbutton
* refactor zoom controls
* refactor: Remove unused svgToPng prop and simplify handleCopy function
* Move zoom to constants and increase max zoom
* feat: add save image functionality and refactor image handling
* feat: add translations
---------
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
* Add reasoning budget support to Bedrock models and update related components
- Introduced `supportsReasoningBudget` property in Bedrock models.
- Enhanced `AwsBedrockHandler` to handle reasoning budget in payloads.
- Updated `ThinkingBudget` component to dynamically set max tokens based on reasoning support.
- Modified `ApiOptions` and `Bedrock` components to conditionally render `ThinkingBudget`.
- Added tests for extended thinking functionality in `bedrock-reasoning.test.ts`.
* Add BedrockThinkingConfig interface and update payload structure
* fix: address PR review feedback (#4481)
- Simplify ThinkingBudget ternary logic since component only renders when reasoning budget supported
- Break down complex thinking enabled condition with clear documentation
- Replace 'as any' usage with proper TypeScript interfaces for AWS SDK events
- Add comprehensive documentation for multiple stream structures explaining AWS SDK compatibility
* feat: add BatchDiffApproval component for multi-file diff application
- Introduced a new component `BatchDiffApproval` to handle the approval of batch changes across multiple files.
- Integrated the `BatchDiffApproval` component into `ChatRow` to display batch diff requests.
- Updated experimental settings to include a toggle for multi-file apply diff functionality.
- Enhanced localization files to support new strings related to batch changes in multiple languages.
- Updated tests to cover the new multi-file apply diff feature.
* revert this
* fix: update applyDiff parameter type to accept string or DiffItem
* refactor: keep original file name for apply diff tool
* revert this
* Update src/core/webview/__tests__/ClineProvider.test.ts
* revert this
* fix: keep the original path if the experiment is disabled
* test: add dynamic strategy selection tests for MultiSearchReplaceDiffStrategy and MultiFileSearchReplaceDiffStrategy
* fix: mock applyDiffTool module and ensure legacy tool resolves successfully in tests
* remove this
* ellipsis suggestion
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* refactor: mirror concurrent file reads
---------
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* feat: add prompt history navigation with arrow keys (#4139)
- Navigate through prompt history using arrow up/down keys
- Only triggers when cursor is at first line (up) or last line (down)
- Preserves current input when starting navigation
- Resets navigation state when typing or sending messages
- Follows VSCode's standard UX patterns for history navigation
* fix: correct prompt history order and add workspace filtering (#4139)
- Remove reverse() to maintain chronological order in history array
- Add workspace filtering to only show prompts from current workspace
- Ensure arrow up navigates to older prompts (as expected)
- Filter history items by workspace field matching current cwd
* test: Fix Windows unit test failures for prompt history navigation
- Add missing taskHistory and cwd properties to all useExtensionState mocks
- Add comprehensive test coverage for prompt history navigation feature
- Ensure all 25 tests pass including new prompt history functionality
Fixes failing Windows CI test in PR #4450
* refactor: Improve cursor positioning with useLayoutEffect
- Replace setTimeout(..., 0) with useLayoutEffect for more reliable cursor positioning
- Implement state-based cursor positioning pattern suggested by @mochiya98
- Add CursorPositionState interface for better type safety
- Maintain all existing functionality while improving timing reliability
This addresses the technical suggestion in PR #4450 comment about using
useLayoutEffect instead of setTimeout for DOM manipulation timing.
* feat: optimize prompt history with performance improvements and memory management
- Add useMemo for prompt history filtering to prevent unnecessary re-computations
- Implement MAX_PROMPT_HISTORY_SIZE = 100 limit for memory management
- Extract logic into usePromptHistory custom hook for better code organization
- Simplify ChatTextArea component by delegating history logic to custom hook
Addresses review feedback on PR #4450 for issue #4139
* refactor: clean up unused code and fix linting issues in prompt history
- Remove unused CursorPositionState interface from ChatTextArea
- Remove unused destructured variables from usePromptHistory hook
- Fix missing dependency in useEffect dependency array
- Rename unused parameter with underscore prefix
Related to #4139
* feat: implement hybrid prompt history with position reset
- In chat: Use conversation messages (user_feedback), newest first
- Out of chat: Use task history, oldest first
- Reset navigation position when switching between history sources
- Switch from taskHistory to clineMessages for active conversations
- Maintain backward compatibility with task history fallback
- Add comprehensive tests for hybrid behavior and position reset
This provides intuitive UX where:
- Users navigate recent conversation messages during tasks (newest first)
- Users access initial task prompts when starting fresh (oldest first)
- Navigation always starts fresh when switching contexts
* fix: correct task history slicing order for prompt navigation
Task history was using .slice(-100) which gets the newest 100 tasks,
but we want to show oldest tasks first when navigating. Changed to
.slice(0, 100) to get the oldest 100 tasks instead.
This ensures that when starting fresh (no conversation), up arrow
shows the oldest task prompts first, which is the intended behavior.
* refactor: remove comment on task history size limitation and clarify order preservation
* refactor: replace local ClineMessage and TaskHistoryItem interfaces with imported types
* fix: prevent prompt history fallback to task list during active conversation
When an active task has only an initial prompt with no follow-up user messages,
the prompt history should return empty instead of falling back to task history.
This fixes the "Starting Fresh" behavior appearing inappropriately.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
* feat: Add DeepSeek R1 support to Chutes provider (#4523)
- Modified BaseOpenAiCompatibleProvider to expose client as protected
- Enhanced ChutesHandler to detect DeepSeek R1 models and parse reasoning chunks
- Applied R1 format conversion for message formatting
- Set appropriate temperature (0.6) for DeepSeek models
- Migrated tests from Jest to Vitest format
- Added comprehensive tests for DeepSeek R1 functionality
This ensures reasoning chunks are properly separated from regular content
when using DeepSeek R1 models via Chutes provider.
* feat: Enhance DeepSeek R1 support with <think> tag handling in Chutes provider
* fix: Correct temperature retrieval in ChutesHandler to use model's info
* fix: Update condition for DeepSeek-R1 model identification in createMessage method
---------
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
fix: reset terminal busy state after manual commands complete (#4319)
- Add terminal.busy = true when shell execution starts
- Add terminal.busy = false when shell execution ends for both Roo and non-Roo terminals
- Add comprehensive tests for busy flag management
- Fixes issue where terminals got stuck in busy state after manual commands
* feat: add MCP viewer and enhanced UI
- Add McpExecutionStatus type with discriminated union for execution states
- Implement McpExecution component with live status updates and collapsible output
- Replace inline MCP UI in ChatRow with dedicated McpExecution component
- Add comprehensive test coverage for useMcpToolTool
- Enhance CodeAccordian to support custom headers
- Improve combineCommandSequences to handle MCP execution flows
* refactor: merge loops in combineCommandSequences for better efficiency
- Reduced from 3 separate loops to 1 main processing loop
- Improved time complexity from O(n²) to O(n)
- Reduced total passes through array from 4 to 2
- Better memory access patterns and cache utilization
* feat: enhance JSON parsing and rendering in McpExecution component
* feat: add mock implementations for react-markdown and remark-gfm
* fix: remove unreachable return statement in ChatRowContent component
* feat(i18n): add execution status messages and error handling for invalid JSON arguments
* test: add parameter validation tests for missing server_name and tool_name
* Update McpExecution component to show server name in header and tool name in approval section
---------
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
feat: Clicking the panel will always focus it
Adds a new `focusPanel` command and utility function to allow focusing the active webview panel (tab or sidebar). This command is now triggered when a user clicks on non-interactive content within the webview, improving user experience by automatically bringing the panel into focus.
This fixes an issue where sometimes the menu options do not appear because the panel is not in focus:
https://github.com/orgs/Kilo-Org/projects/4/views/1?pane=issue&itemId=113936749&issue=Kilo-Org%7Ckilocode%7C619
**Details**
- **New Command:** Introduced `focusPanel` command to programmatically focus the webview panel.
- **Utility Function:** Created `src/utils/focusPanel.ts` to encapsulate the logic for revealing tab panels or focusing sidebar panels.
- **Webview Integration:** Added a `focusPanelRequest` message type to `WebviewMessage` and implemented a handler in `webviewMessageHandler` to execute the new `focusPanel` command.
- **User Experience:** Implemented a `useAddNonInteractiveClickListener` hook in `webview-ui` that sends a `focusPanelRequest` message to the extension when a click occurs on non-interactive elements, ensuring the webview gains focus.
- **Refactor:** Modified the `focusInput` command to utilize the new `focusPanel` utility, reducing code duplication and centralizing panel focus logic.
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
* fix: TaskItem display and copy issues with HTML tags in task messages.
* Display issue: HTML tags not displaying in HistoryView.
* Copy issue: HTML tags in message are removed when clicking the copy button in TaskItem.
* perf(webview-ui): add LRU cache to escapeHtml function
- Add LRU cache with 500 item limit for escapeHtml results
- Improves performance by caching frequently escaped strings
- Reduces redundant HTML escaping operations
---------
Co-authored-by: Jimmycai <jimmycai@qiyi.com>
Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
Currently, when you use OpenRouter with your own key for the underlying service, the costs shown by Roo Code are way off what it actually costs.
With bring your own key, OpenRouter charges 5% of what it normally would (see https://openrouter.ai/docs/use-cases/byok)
so we have to multiply the reported cost by 20 to get an estimate of what it actually costs.
Co-authored-by: Johan Otten <drakonen@drakonen.com>
Co-authored-by: Eamon Nerbonne <eamon@nerbonne.org>