Introduces a new skill definition for the `code-simplifier` in the `.cline/skills` directory. This skill provides a framework for refining code clarity, consistency, and maintainability while strictly preserving functionality and adhering to project-specific standards.
* chore: add grit rule to enforce Logger service over console calls
Add a new Grit linting rule that detects direct console method usage
(log, debug, error, warn, info) and prompts developers to use the
Logger service instead for consistent logging practices.
The rule is configured in biome.jsonc to apply to most source files
while excluding test files, webview-ui, evals, standalone, e2e tests,
and scripts where direct console usage may be acceptable.
* support variadic args
* wip: migrate console to Logger
* migrate rest of console logger
* Switch to Logger
* Migrations
* shared
* use shared
* revert format change
* Update tests to stub Logger instead of console
* verbose in dev mode
Add vscode-remote: scheme to the valid URI filter for drag & drop operations.
This allows files from SSH Remote workspaces to be dropped into the chat.
Fixes#7606
- cline command permission flag can now parse subshells correctly and
validate that subshells don't contain disallowed commands.
Co-authored-by: Max Paulus 🥪 <max@cline.bot>
- Users with ChatGPT Plus or Pro subscriptions can now use GPT-5 models directly through Cline without needing an API key. Authentication is handled via OAuth through OpenAI's authentication system.
- Grok models are now moving out of free tier and into paid plans.
- Introduces comprehensive Jupyter Notebook support for Cline, enabling AI-assisted editing of `.ipynb` files with full cell-level context awareness.
- Bugs in DiffViewProvider for file editing
- Ollama's recommended models to use correct identifiers
Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
* feat(rules): Write technical design / implementation plan doc.
* update frontmatter plan
* feat(rules): Initial implementation based on plan doc.
* feat(rules): Add tool-call path harvesting for path-scoped Cline Rules.
* chore(rules): exclude internal paths-frontmatter plan doc from PR
* fix(rules): use latest user message for paths frontmatter context
* feat(rules): Implement conditional_rules_applied say type.
* feat(rules): changes as per Cline's code review feedback
* feat(rules): npm run changeset
* feat(rules): Changes as per ellipsis-dev feedback.
* feat(rules): Changes as per code review feedback (i.e. don't bloat the task context).
* feat(rules): Fix failing unit tests.
* refactor(diff): return result object with line tracking metadata
Change constructNewFileContent to return an object containing newContent
and line number information instead of just the string content. Add
charIndexToLineNumber helper function to support tracking where changes
occur in the file.
Update all callers and tests to access the newContent property from
the result object.
* minor fix
* fix: hide line numbers when not available from backend
* chore: add changeset
* feat: add startLineNumbers support to ApplyPatchHandler
* fix: split V4A @@ chunks into separate Patch objects for proper line numbers
* fix(DiffEditRow): preserve +/- prefix in diff line display for backwards compatibility
* fix line numbers
* feat: update free onboarding models with Kat Coder Pro and Devstral
- Replace xAI Grok Code Fast 1 with KwaiKAT Kat Coder Pro as primary free model
- Add Mistral Devstral 2512 as additional free model option
- Update model specifications (context window, image/cache support)
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix initial prompt bugs
- going straight to act wasn't working in interactive mode.
- slash command autocomplete wasn't working in the initial prompt
- refactored some naming to be more clear
* Apply suggestion from @ellipsis-dev[bot]
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* Apply suggestion from @ellipsis-dev[bot]
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* Apply suggestion from @ellipsis-dev[bot]
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
---------
Co-authored-by: Max Paulus 🥪 <max@cline.bot>
Co-authored-by: CandiedUniverse <132302818+candieduniverse@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* fix: restore switchToSpecializedEditor for Jupyter notebook diff views
This restores the notebook diff view functionality that was accidentally
removed during rebase. The method was incorrectly identified as dead code,
but it was being called in update() when isFinal is true.
Restored functionality:
- Abstract method definition in DiffViewProvider
- Call to switchToSpecializedEditor() in update() after final content
- Full implementation in VscodeDiffViewProvider for notebook diff views
- Temporary file management for modified content
- File system watcher for synchronization
- Proper cleanup in resetDiffView()
- No-op implementations in ExternalDiffViewProvider and FileEditProvider
- Test stub in DiffViewProvider.test.ts
* fix: open notebooks in Jupyter editor after save, strip outputs for LLM
- Override showFile in VscodeDiffViewProvider to open .ipynb files
with the Jupyter notebook editor instead of leaving stale diff view
- Remove notebook check that was skipping showFile in base class
- Add getOriginalContentForLLM() to return sanitized notebook content
- Strip notebook outputs from finalContent to reduce LLM context size
fix: sanitize notebook content in write responses to prevent context explosion
Previously, after editing a notebook, the full file content (including all
base64-encoded images and HTML table outputs) was sent back to the LLM in
the <final_file_content> response. This caused context to explode to ~200K
tokens for simple edits on notebooks with rendered outputs.
Changes:
- Add stripAllOutputs option to sanitizeNotebookForLLM()
- Apply sanitization in DiffViewProvider.saveChanges() for finalContent
- Add getOriginalContentForLLM() for diff error responses
- Strip all outputs (not just images) in write paths since outputs
aren't needed for editing - they regenerate when cells run
Results: 95% reduction in context usage for notebook write responses
(196KB → 9KB in testing).
* chore: add changeset for Jupyter notebook diff view fix
* fix: show error message when Jupyter extension is missing for notebook diffs
* refactor: move os require to top-level import
---------
Co-authored-by: Max <maxpaulus43@gmail.com>
Adds a detailed comment explaining that each VS Code window has its own
StateManager cache, which is why settings like plan/act mode don't sync
between running instances. The cache is populated from disk only during
initialize() and never re-read, providing natural isolation.
* fix: prevent duplicate diff errors when parallel tool calling is enabled
When a `replace_in_file` diff fails during streaming with parallel tool
calling enabled (GPT-5/Codex models), the same error message was being
added to userMessageContent on each streaming chunk, causing hundreds of
duplicates and context window overflow.
Root cause: The duplicate prevention added in 09276ebf4 used the
`didAlreadyUseTool` flag, but this flag is intentionally not set when
parallel tool calling is enabled (per 00e9d6f52). This was because
`didAlreadyUseTool` is designed to block subsequent tools, which is the
opposite of what parallel tool calling needs.
The fix adds per-call_id tracking via `diffErrorPushedForCallIds` Set:
- Track which specific tool calls have already had their error pushed
- Works for both parallel and non-parallel tool calling
- Different parallel tool calls can each report their own errors
- Same call_id only pushes error once, regardless of streaming chunks
This is compatible with the parallel tool calling design because GPT-5
models (which auto-enable parallel tool calling) use native tool calling
and always have a call_id. The mechanism is separate from didAlreadyUseTool
which controls flow (blocking tools) vs this which prevents duplicates.
Related commits:
- 09276ebf4: fix: prevent duplicate error messages during streamed edit
tool failures (only worked when parallel tool calling disabled)
- 00e9d6f52: feat: add experimental parallel tool calling support
(deliberately excluded didAlreadyUseTool from parallel mode)
* test: add unit tests for diffErrorPushedForCallIds duplicate prevention
Tests cover:
- Basic Set behavior (initialization, tracking, clearing)
- Duplicate prevention logic for parallel tool calling
- Edge cases (empty/undefined call_id, rapid streaming chunks)
- Reset behavior between API requests
* Add changeset
* refactor: rename diffErrorPushedForCallIds to errorPushedForCallIds
Generalizes the tracking mechanism per reviewer feedback from @abeatrix.
The more generic name allows the same pattern to be reused for other
tool handlers that may need duplicate error prevention in the future,
not just diff-related errors.
No functional changes - just renaming.
When file operations use the approval flow (isFinal=false), the document
content was not being properly finalized before user approval. This caused
content duplication when shortening files - old content at the end was
preserved instead of being replaced.
Root cause: FileProviderOperations passed isFinal=false to
DiffViewProvider.update(), which:
1. Popped the last line (treated as "incomplete" for streaming)
2. Limited the replacement range to currentLine + 1
3. Skipped truncation of trailing content
Fix: Always pass isFinal=true to update() since the content IS complete.
The isFinal parameter in FileProviderOperations now only controls whether
to save after the update, not the update behavior itself.
This follows the philosophy of dd35448a9 by fixing at the source rather
than adding cleanup logic.
* style: improve OAuth success page design
* fix: hide thinking budget slider for OpenAI Codex provider
OpenAI Codex models use discrete reasoning effort levels (low/medium/high)
controlled via the global OpenAI Reasoning Effort setting, not token-based
thinking budgets like Anthropic models.
* fix: hide thinking toggle with display:none instead of disabled state
* fix: hide cost display for OpenAI Codex provider
Subscription-based provider has no per-token costs, so showing $0.00 is misleading.
* fix: disable delete button for favorited history item
- Add useMemo hook to memoize favorite state calculation, improving performance by avoiding repeated computations of `pendingFavoriteToggles[item.id] ?? item.isFavorited`
- Disable delete button for favorited items but keep delete button for standardized UI display
- Replace multiple inline favorite state checks with centralized `isFavoritedItem` variable for better code maintainability
- Simplify favorite toggle logic by using memoized value
This change ensures favorited items cannot be deleted and reduces unnecessary re-renders when favorite state is accessed.
* isFavoritedItem
* docs: fix outdated Ollama model names in documentation
Fixes#7918
- Updated qwen3-coder-30b to qwen2.5-coder:32b (correct identifier)
- Replaced devstral-small with codellama:34b-code (existing model)
- Changed ollama run to ollama pull for initial download
* chore: add changeset for Ollama model names fix
* Jupyter Notebook Enhancements
* fix: implement dynamic notebook instructions for replace_in_file
Leverages the new dynamic prompt infrastructure to conditionally inject Jupyter Notebook-specific instructions into the `replace_in_file` tool. This ensures that the model receives guidance on handling JSON structure in `.ipynb` files only when the `enhancedNotebookInteractionEnabled` setting is active, keeping the default prompt clean for other users.
- Added `enhancedNotebookInteractionEnabled` to global settings and system prompt context
- Updated `replace_in_file` tool to use a dynamic instruction function that appends notebook rules based on context
- Wired up state management to pass the setting value to the prompt builder
* refactor: unify notebook output sanitization across two code paths
Previously, context menu commands (Add to Cline, Explain, etc.) wiped ALL
notebook outputs, while file mentions preserved text and only truncated images.
Additionally, when outputs weren't cleared, massive base64-encoded image data
was sent directly to the LLM, flooding context with garbage.
Changes:
- Create shared notebook-utils.ts with sanitization logic
- Update extract-text.ts to use shared utility
- Update commandUtils.ts to sanitize instead of clearing outputs
Both paths now truncate base64 image data with "[IMAGE DATA TRUNCATED]"
while preserving useful text outputs like print statements and errors.
* feat(improve): unify prompt sending behavior for improveWithCline
Refactor improveWithCline to build a single prompt and handle sending uniformly: for notebooks, populate existing task if available and send immediately; otherwise, create new task. This unifies behavior across selected text and notebook contexts, removing dependency on sendAddToInputEvent and simplifying logic. Minor formatting tweaks in extension.ts for notebook context string.
* refactor: remove notebook_cell_json from proto, move notebook context to dedicated commands
The contributor's original implementation added notebook_cell_json to the
CommandContext proto, which was then populated in getContextForCommand() for
any notebook file when enhancedNotebookInteractionEnabled was set.
This couples notebook-specific functionality to the general command proto,
which feels heavy for a niche feature. Protos should stay clean and general.
Changes:
- Remove notebook_cell_json field from CommandContext proto
- Export findMatchingNotebookCell() from commandUtils.ts
- Update Jupyter commands (JupyterGenerateCell, JupyterExplainCell,
JupyterImproveCell) in extension.ts to fetch cell JSON directly and
bundle it into the notebookContext parameter
- Update command files to use only notebookContext parameter
- Remove notebook-specific handling from getContextForCommand()
Result: Notebook context only flows through dedicated Jupyter commands.
Regular commands (Add to Cline, Fix, etc.) work the same for all file types.
The proto stays clean and general-purpose.
Note: This removes the behavior where regular commands would get notebook
context when used on .ipynb files with enhancedNotebookInteractionEnabled.
That feature is now exclusive to the dedicated Jupyter menu commands.
* feat: improve notebook handling for empty notebooks
- Add semicolon to import statement for consistency
- Prevent errors by checking cell count before accessing notebook cells
- Add fallback in getContextForCommand for active notebook editor when no text editor is available
- Ensures robustness when dealing with empty or cell-less notebooks in the VSCode extension
* refactor: extract common notebook context logic for Jupyter commands
Extracted duplicated code into a helper function `getNotebookCommandContext` to handle active notebook checks, context retrieval, and cell JSON fetching. This reduces duplication in `JupyterGenerateCell` and `JupyterExplainCell` commands, improving code maintainability and readability. Minor import semicolon fix for consistency.
* fix: block notebook edits when enhanced interaction disabled
Prevent crashes when enhancedNotebookInteractionEnabled is false by blocking .ipynb file edits in WriteToFileToolHandler. Added validation to return an error message instructing the user to enable the setting, and set didRejectTool to stop the operation. Reading notebooks remains unaffected.
* fix(mentions): reorder parameters in parseMentions signature
Reordered the parameters in the parseMentions function to move the default parameter to the end of the argument list. This change ensures consistency in the function signature and correctly aligns arguments at the call site in the Task class.
This update was done to fix failing tests.
* Created proper diff views for vscode nd removed unnecessary logs
* feat: make replace_in_file prompt dynamic based on open files
Add editorTabs to SystemPromptContext to expose open/visible files.
Populate editorTabs in Task using HostProvider.
Conditionally include notebook-specific instructions in replace_in_file tool only when .ipynb files are open or visible.
Refactor replace_in_file prompt construction for better readability.
* feat: enable enhanced notebook interaction by default
Remove enhancedNotebookInteractionEnabled feature flag and enable notebook support globally.
Update tool handlers to process notebook cells automatically.
Update file extraction logic to support .ipynb files natively.
Clean up settings UI and state management.
* fix: restore accidentally removed promptContext fields
Commit ec68e7c2a accidentally removed enableParallelToolCalling and
terminalExecutionMode from promptContext when refactoring to add
editorTabs. These fields are still in SystemPromptContext interface
and actively used by system prompt templates.
* fix: complete feature flag removal from package.json
Commit a1dc73f93 removed the enhancedNotebookInteractionEnabled flag
from runtime code but forgot to update package.json. The Jupyter menu
items were hidden because the when conditions checked a setting that
defaulted to false.
- Remove config check from notebook menu item when conditions
- Remove unused setting definition
* fix: change changeset from minor to patch
* fix: code quality improvements in VscodeDiffViewProvider
- Use proper ES6 import for os module instead of require()
- Remove dead commented-out code (closeCurrentTextDiffEditor)
- Improve comment explaining the render delay
* fix: watch specific temp file instead of entire directory
* test: update snapshots for replace_in_file whitespace change
The PR's refactoring of replace_in_file.ts changed indentation in
the tool description from tabs to spaces. Updating snapshots to
match.
* fix: remove merge artifact marginTop from checkpoints div
* test: update DiffViewProvider test stub for new abstract method
* fix: remove dead notebook diff view code (switchToSpecializedEditor)
The switchToSpecializedEditor() method was declared as abstract and
implemented in all DiffViewProvider subclasses, but was never called
from anywhere. This meant ~180 lines of notebook diff view code
(temp file management, file watchers, cleanup) would never execute.
Removing this dead code. The notebook diff view feature will need a
follow-up PR to properly integrate it by calling the method from the
update() flow when isFinal is true.
---------
Co-authored-by: Robin Newhouse <robin@cline.bot>
Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
Change trigger from every push to:
- PR open/reopen only (removed synchronize)
- Manual /test-jetbrains comment command
This prevents the bot from posting a comment on every single commit,
which was cluttering PR conversations.
* feat: add OpenAI Codex provider for ChatGPT Plus/Pro subscriptions
Add a new provider that allows users with ChatGPT Plus or Pro subscriptions
to use GPT-5 models directly through Cline without needing an API key.
Key features:
- OAuth authentication via OpenAI (PKCE flow)
- Routes requests to chatgpt.com/backend-api/codex/responses
- Subscription-based pricing (no per-token costs)
- Models: gpt-5.2-codex, gpt-5.1-codex-max, gpt-5.1-codex-mini, gpt-5.2
New files:
- src/integrations/openai-codex/oauth.ts: OAuth manager with PKCE, token storage/refresh
- src/core/api/providers/openai-codex.ts: API handler for Codex backend
- src/core/controller/account/openAiCodexSignIn.ts: Sign-in RPC handler
- src/core/controller/account/openAiCodexSignOut.ts: Sign-out RPC handler
- webview-ui/src/components/settings/providers/OpenAiCodexProvider.tsx: Settings UI
* fix: force native tool calling for Responses API providers
Providers using OpenAI's Responses API (openai-codex, some openai-native
models) require native tool calling. XML tools don't work with these APIs,
causing duplicate tool calls and malformed arguments.
Changes:
- Add openai-codex to isNextGenModelProvider() list so native variant
matchers recognize it
- Force enableNativeToolCalls=true when model uses ApiFormat.OPENAI_RESPONSES,
regardless of user setting
- Document Responses API provider requirements in CLAUDE.md
* chore: rename OpenAI Codex provider label to ChatGPT Codex Subscription
* fix: use shared fetch wrapper for proxy support in OpenAI Codex provider
* revert: remove CLAUDE.md changes from this PR
* fix: restore .clinerules/general.md to match main
* chore: rename provider label to OpenAI Codex (ChatGPT Plus/Pro)
* chore: add network.md reference to clinerules
* feat: show VS Code notifications for OpenAI Codex OAuth success/failure
* Fixed provider logic to handle Azure Commercial and Azure Government based on domain suffix.
* Adjusted region logic for simple long term modifications for other soverign cloud regions.
* feat: add cloud storage and sync system infrastructure
Add cloud storage capabilities with support for R2 and S3 adapters:
- Add ClineBlobStorage class for cloud-based state persistence
- Implement R2 and S3 storage adapters with AWS4 signing
- Initialize sync system on extension activation and dispose on teardown
- Refactor StateManager to integrate with secret storage
- Add required dependencies: aws4fetch for AWS request signing and yaml for configuration parsing
This enables uploading Cline state across devices using cloud storage providers when configured.
* refactor: remove yaml dependency and refactor storage/backfill logic
Replace YAML serialization with JSON for API conversation history storage.
Refactor backfill worker to read task IDs from history file instead of
filesystem directory scanning, improving performance and consistency.
Changes:
- Remove yaml package dependency (^2.8.2)
- Switch from YAML.stringify to JSON.stringify in saveApiConversationHistory
- Refactor listTaskIds to read from task history state file
- Add timestamp-based filtering using taskId parsing
- Remove filesystem-based directory scanning logic
- Remove unused getFileMtime function and useQueue option
This simplifies dependencies and aligns storage format across the codebase
while improving backfill efficiency by avoiding directory traversal.
* clean up
* clean up
* feat(worker): add queue cleanup and size enforcement mechanisms
- Add cleanupFailedItems() method to remove failed items exceeding max retries or age threshold
- Add enforceMaxSize() method to enforce maximum queue size with priority-based eviction
- Add maxQueueSize and maxFailedAgeMs configuration options (configurable via env vars)
- Run cleanup before processing to prevent unbounded queue growth, even when blob storage is misconfigured
This prevents the sync queue from growing indefinitely in misconfigured environments by automatically evicting stale failed items and enforcing a maximum queue size (default: 1000 items, 7-day failed item retention).
* feat(sync): add remote config support for blob store settings
- Add support for remote config blob store settings with env var fallback
- Pass blob store configuration through SyncWorkerOptions to init
- Extract getBlobStoreSettingsFromEnv() helper for environment-based config
- Update blob storage initialization to accept settings parameter
- Replace ClineBlobStorage.isConfigured() with blobStorage.isReady()
- Move backfill flag from env var to options parameter
- Ensure proper initialization flow with settings validation
This change enables dynamic blob store configuration from remote config
while maintaining backward compatibility with environment variables as
a fallback mechanism.
* apply feedback
* apply feedback
* remove global fetch import
* remove secretStorage init. use const
* use a single pass with forEach instead of filter-map-delete loops
* Schema changes for prompt uploading
* Fix types and add tests
* Add tests
* Remove test
* Addapt to the BlobStoreSettings
* Add tests
* Add the missing fields
* Extend tests
---------
Co-authored-by: abeatrix <beatrix@cline.bot>
* feat: add cloud storage and sync system infrastructure
Add cloud storage capabilities with support for R2 and S3 adapters:
- Add ClineBlobStorage class for cloud-based state persistence
- Implement R2 and S3 storage adapters with AWS4 signing
- Initialize sync system on extension activation and dispose on teardown
- Refactor StateManager to integrate with secret storage
- Add required dependencies: aws4fetch for AWS request signing and yaml for configuration parsing
This enables uploading Cline state across devices using cloud storage providers when configured.
* refactor: remove yaml dependency and refactor storage/backfill logic
Replace YAML serialization with JSON for API conversation history storage.
Refactor backfill worker to read task IDs from history file instead of
filesystem directory scanning, improving performance and consistency.
Changes:
- Remove yaml package dependency (^2.8.2)
- Switch from YAML.stringify to JSON.stringify in saveApiConversationHistory
- Refactor listTaskIds to read from task history state file
- Add timestamp-based filtering using taskId parsing
- Remove filesystem-based directory scanning logic
- Remove unused getFileMtime function and useQueue option
This simplifies dependencies and aligns storage format across the codebase
while improving backfill efficiency by avoiding directory traversal.
* clean up
* clean up
* feat(worker): add queue cleanup and size enforcement mechanisms
- Add cleanupFailedItems() method to remove failed items exceeding max retries or age threshold
- Add enforceMaxSize() method to enforce maximum queue size with priority-based eviction
- Add maxQueueSize and maxFailedAgeMs configuration options (configurable via env vars)
- Run cleanup before processing to prevent unbounded queue growth, even when blob storage is misconfigured
This prevents the sync queue from growing indefinitely in misconfigured environments by automatically evicting stale failed items and enforcing a maximum queue size (default: 1000 items, 7-day failed item retention).
* feat(sync): add remote config support for blob store settings
- Add support for remote config blob store settings with env var fallback
- Pass blob store configuration through SyncWorkerOptions to init
- Extract getBlobStoreSettingsFromEnv() helper for environment-based config
- Update blob storage initialization to accept settings parameter
- Replace ClineBlobStorage.isConfigured() with blobStorage.isReady()
- Move backfill flag from env var to options parameter
- Ensure proper initialization flow with settings validation
This change enables dynamic blob store configuration from remote config
while maintaining backward compatibility with environment variables as
a fallback mechanism.
* apply feedback
* apply feedback
* remove global fetch import
* remove secretStorage init. use const
* use a single pass with forEach instead of filter-map-delete loops
---------
Co-authored-by: Tomás Barreiro <52393857+BarreiroT@users.noreply.github.com>
I belive the file is duplicated of src/core/api/providers/dify.ts file.
new DifyHandler is imported from src/core/api/providers/dify.ts and the removed dify file is not being used
Some GPT-5.1/5.2 (codex) models can trigger OpenAI Responses API errors like: 'function_call was provided without its required reasoning item'.
Root cause: PromptRegistry selects the first matching variant; our native-gpt-5 matcher previously let any 'codex' model bypass the gpt-5.1/gpt-5.2 exclusion, so gpt-5.2-codex could incorrectly match NATIVE_GPT_5 instead of NATIVE_GPT_5_1.
Change: route all GPT-5.1 and GPT-5.2 models (including codex variants) to NATIVE_GPT_5_1; keep GPT-5 (and gpt-5-codex) on the less strict NATIVE_GPT_5.
This was observed as a hard-to-reproduce, sporadic error, but we want the safer routing available for anyone hitting it.
Wrap the call to `HostProvider.logToChannel` in a try/catch block so that logging does not throw when the host provider is not ready or unavailable.
Remove the now‑unused `ErrorService` imports and logging calls, keeping the logger focused on its core responsibility while preventing unnecessary failures during startup or testing. P.S: ErrorService is not enabled
* feat: support native tool call for ollama and lmstudio
Implemented conditional exposure of native tools in the system prompt based on `enableNativeToolCalls`. Updated the XS variant used by ollama and lmstudio configuration to match local models only and removed obsolete tool references. Added comprehensive tool overrides for both native and non‑native scenarios.
* add changeset
* update snippets and templates
* feat(cli): add version to root cobra command
Expose --version by setting the root command version.
* feat(cli): include core version in CLI version output
Format the CLI version string to show both CLI and core versions for clarity
* feat(cli): centralize version string output for CLI
Add a shared VersionString helper and use it for the
version command and Cobra version template, while
keeping the root command version to CLI only.
* feat: add git worktree management UI
Adds a worktrees view accessible from the navbar that allows users to:
- View all existing worktrees with their branch and path info
- Create new worktrees from local/remote branches or new branches
- Switch between worktrees (opens folder in VS Code)
- Delete worktrees with confirmation
Implementation includes:
- New proto definitions for worktree service RPCs
- Controller handlers for CRUD operations
- Git worktree utility functions
- WorktreesView React component with full UI
- Navbar integration with worktree button
* feat: enhance worktree creation error handling in WorktreesView
Adds error state management for worktree creation in the WorktreesView component. Introduces a new state variable to capture and display error messages when worktree creation fails, improving user feedback during the process.
* feat: add worktree defaults retrieval to WorktreeService and UI
Introduces a new RPC method `getWorktreeDefaults` to fetch suggested defaults for branch names and paths when creating new worktrees. Updates the WorktreesView component to utilize this method, enhancing the user experience by auto-generating branch names and paths. Additionally, integrates tooltips for improved UI interactions and adds a close button to the worktree creation modal.
* feat: implement .worktreeinclude file management in WorktreeService
Adds new RPC methods to the WorktreeService for managing .worktreeinclude files, including retrieving the status of the file and creating it with specified content. Updates the WorktreesView component to handle the creation and status checking of .worktreeinclude, enhancing user experience by automating file management for worktrees. Additionally, modifies the UI to reflect these changes, including updated tooltips and improved error handling.
* feat: add checkout branch functionality to WorktreeService and UI
Introduces a new RPC method `checkoutBranch` to the WorktreeService for switching branches within the current worktree. Updates the WorktreesView component to support this functionality, enhancing user experience by allowing seamless branch switching. Additionally, refines the UI layout for better responsiveness and improves loading/error state handling.
* feat: reposition New Worktree button for improved UI layout
Moves the New Worktree button to a fixed position at the bottom of the WorktreesView component, enhancing accessibility and user experience. The button is now styled to occupy the full width, ensuring better visibility and interaction within the UI.
* feat: update documentation links in WorktreesView component
Modifies the documentation links in the WorktreesView component to point to the correct feature sections, ensuring users have access to accurate resources. Additionally, adds the "features/worktrees" entry in the documentation JSON for better organization.
* feat: add worktree merging functionality and UI enhancements
Introduces a new feature for merging worktrees, allowing users to merge changes from a worktree's branch into the main branch with options to delete the worktree post-merge. Updates the WorktreesView component to include a merge modal, handling merge conflicts, and integrating with the WorktreeService for seamless operations. Additionally, enhances documentation to reflect these changes.
* refactor: replace exec with simple-git for worktree operations
Refactors the worktree management code to utilize the simple-git library instead of child_process exec for executing Git commands. This change enhances code readability and maintainability by providing a more streamlined interface for Git operations in the checkoutBranch, mergeWorktree, and git-worktree modules. Additionally, it improves error handling and reduces the complexity of command execution.
* feat: enhance mergeWorktree functionality to check target worktree status
Implements a check for uncommitted changes in the target worktree before merging, ensuring that users are informed if the target branch has uncommitted changes. This update improves error handling and user feedback during the merge process by verifying the state of both the source and target worktrees. Additionally, it integrates the listWorktrees utility to identify the correct worktree for the target branch.
* refactor: optimize worktree loading to prevent UI flickering
Enhances the loadWorktrees function in WorktreesView to only update the component's state if the fetched data has changed, reducing unnecessary re-renders and preventing flickering. This change improves the user experience by providing a smoother interface when loading worktrees. Additionally, simplifies the polling mechanism for updates.
* feat: update merge conflict display and task creation flow in WorktreesView
Enhances the merge conflict notification by providing a clearer list of conflicting files, including a summary for additional files. Additionally, modifies the task creation flow to close the worktrees view upon task creation, improving user experience during the merge process.
* fix: improve tooltip functionality and clean up WorktreesView component
Enhances the tooltip for the current worktree indicator to provide additional context for users. Additionally, removes the display of commit hashes in the worktree list to streamline the UI, improving overall clarity and user experience.
* feat: add symlink functionality for .worktreeinclude to sync with .gitignore
Introduces a new section in the documentation explaining how to create a symlink from .gitignore to .worktreeinclude. This allows users to automatically sync patterns between the two files, simplifying worktree setup. Additionally, includes a note for users needing different patterns to create a regular .worktreeinclude file instead.
* fix: simplify merge request button in WorktreesView component
Removes the "Merge" text from the button label in the WorktreesView component, streamlining the user interface. This change focuses on clarity by allowing the button to simply prompt users to "Ask Cline to Resolve," enhancing the overall user experience during merge conflict resolution.
* Update docs/features/worktrees.mdx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update webview-ui/src/components/worktrees/WorktreesView.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Fixes docs not rendering
* perf(worktree): optimize file copying for .worktreeinclude
Address performance feedback - worktree creation was taking ~20 seconds
for large directories like node_modules (50k+ files).
Optimizations:
- Use native `cp -r` for entire directories (10-20x faster)
- Parallelize file copying with batches of 100 (5-10x faster)
- Parallelize directory traversal with Promise.all
The old implementation copied files sequentially which caused the
bottleneck. Now directories like node_modules are copied using the
system's native cp command, and individual files are copied in
parallel batches.
Also adds unit tests for the worktree-include module.
* feat(worktree): add multi-root and subfolder workspace warnings
- Detect and warn when multiple workspace folders are open (worktrees not supported in multi-root)
- Detect and warn when a subfolder of a git repo is open instead of the root, showing the actual git root path
- Fix UI overflow on narrow widths by using min-h-32 instead of fixed h-32
* refactor(worktree): auto-fill defaults when create modal opens
* fix(worktree): add cursor pointer to create modal close button
* feat(worktree): add clear buttons to create modal input fields
* feat(worktree): add quick launch button on home page
Extract CreateWorktreeModal as reusable component with openAfterCreate prop.
Add New Worktree Window button to WelcomeSection that creates a worktree
and opens it in a new window. Shows current worktree branch and path info.
* refactor(ui): polish home screen and worktree modal
- Update HistoryPreview: rename to Recent, move View All to header with chevron
- Remove logo pop-in animation from HomeHeader
- Remove info icon tooltip from What can I do for you heading
- Remove fade-in animations from WelcomeSection
- Move worktree button below history preview with more spacing
- Update CreateWorktreeModal copy and reduce spacing between fields
- Add Current label with branch icon above path in worktree info
* feat(worktree): auto-open Cline sidebar on worktree launch
When switching to a worktree via quick launch button, automatically
open the Cline sidebar in the new/reloaded window. Uses globalState
to pass the target path between windows, reading directly from
context.globalState at startup to bypass StateManager cache timing.
* fix(worktree): improve quick launch UX
- Make current branch/path clickable to navigate to worktrees view
- Fix word wrap for long branch names and paths
- Show .worktreeinclude warning in create modal with learn more link
* chore: ignore .worktrees directory and CLAUDE.local.md
* feat(worktree): add delete confirmation modal
* refactor(ui): remove worktrees button from title bar
* fix(worktree): improve .worktreeinclude warning styling
* docs(worktrees): update for new UI features
- Document quick launch button on home screen
- Update getting started to reflect auto-filled defaults
- Document Cline auto-open behavior when switching worktrees
- Update delete section with confirmation modal details
- Add limitations section for multi-root and subfolder workspaces
* fix(worktree): rename Main badge to Primary
* feat(worktree): add worktrees button to sidebar header
Adds a git-branch icon button to the Cline sidebar header for quick
access to the Worktrees view. Also updates docs to mention this new
entry point and adds a typical workflow section.
* fix(worktree): UI polish
- Change New Worktree Window tooltip to show above button instead of below
- Add break-all to branch names for long branch text wrapping
- Simplify merge button tooltip and modal title (remove 'and close')
* fix(e2e): update tests to match renamed Recent header
* fix(worktree): improve non-git repo message
* fix(worktree): wrap path instead of truncating
* fix(e2e): update auth test to use aria-label instead of removed class
* fix(worktree): add option to delete branch when deleting worktree
- Update delete modal copy to accurately describe behavior
- Add checkbox to optionally delete branch (unchecked by default)
- Show warning about unpushed commits when checkbox is checked
- Update proto, handler, and UI to support delete_branch option
* fix: remove worktrees menu button from sidebar
Remove the worktrees button from the VS Code extension menu bar.
* fix(ui): temporarily disable new worktree button, add tooltip to current worktree
Comment out "New Worktree Window" button until worktree creation is stable.
Add tooltip to current worktree info with "View and manage git worktrees.
Great for running parallel Cline tasks."
* feat: add worktree-exp feature flag for worktrees feature
Put the worktrees feature behind a feature flag (worktree-exp) that
defaults to false. When enabled, users can toggle the feature in
settings. The home page worktree section only shows when both the
feature flag is enabled and the user setting is on.
* feat: add telemetry for worktree feature usage
Track worktree feature engagement:
- worktree.view_opened: when users open worktrees view (with source)
- worktree.created: when worktrees are created (with total count)
- worktree.merge_attempted: when merge is attempted (success/conflicts)
* fix: replace DangerButton with Button variant="danger"
DangerButton component was removed from main. Use the standard
Button component with variant="danger" instead.
* Fix merge conflict artifacts
* Revert "fix(e2e): increase getSidebar timeout for slower macOS CI runners"
This reverts commit 19479a019c.
* fix: clean up shadow git checkpoint data when deleting worktrees
* fix: add worktreesEnabled to proto and fix duplicate import
* fix: revert e2e test changes to match main
* fix: revert Navbar.tsx to match main (JetBrains compat)
* fix: revert package.json navigation order to match main
* fix: properly add worktrees_enabled to proto without moving fields
* fix(e2e): update tests to match UI changes
- Change "Recent Tasks" to "Recent" to match HistoryPreview header
- Use aria-label selector for BannerCarousel instead of animate-fade-in class
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Juan Pablo <juan@cline.bot>
* feat(telemetry): add exit code to terminal execution telemetry
Include process exit code in standalone terminal execution telemetry
to help diagnose failure types. Common codes like 127 (command not found)
and 126 (permission denied) provide valuable debugging information.
- Add optional exitCode parameter to captureTerminalExecution
- Only include exitCode when it has a meaningful value
- Update comments to clarify failure diagnosis purpose
* feat(temp): add centralized temp file manager with auto-cleanup
Introduce ClineTempManager to handle all Cline temporary files:
- Uses "cline-" prefix for easy identification
- Automatically cleans up files older than 50 hours on activation
- Enforces 2GB total size cap to prevent disk bloat
- Cross-platform support (macOS, Windows, Linux)
Refactor CommandOrchestrator and StandaloneTerminalManager to use the
new centralized temp file management instead of direct os.tmpdir() calls.
* feat: add periodic temp file cleanup every 24 hours
- Add startPeriodicCleanup() and stopPeriodicCleanup() methods to ClineTempManager
- Start 24-hour cleanup interval on extension activation
- Stop cleanup interval on extension deactivation
- Use unref() on interval to prevent blocking Node exit
* minor fix
* minor fix
* fix: centralize temp cleanup and scan full temp dir
Move initial cleanup into startPeriodicCleanup, ensure temp
directory exists, and process all temp files with safer error
handling to avoid misses and race deletions.
* minor fix
* chore: shows arrow for history item details on hover only
Add subtle bottom border to history items for better visual separation and improve expand/collapse icon visibility by hiding it by default and showing it only on hover with a smooth opacity transition. This creates a cleaner interface while maintaining discoverability of the expand functionality.
Changes:
- Add border-bottom with low opacity accent color to history items
- Hide expand/collapse chevron icon by default
- Show chevron on hover with smooth opacity transition
* align checkbox
Add explicit checks in the Native GPT‑5 variant to enable the variant for
`gpt‑oss` model IDs and reject non‑next‑generation providers. The provider
list in `model-utils.ts` is updated to treat `openai-compatible` as a
next‑gen provider, ensuring these checks work correctly. This change
allows the system to correctly identify and use gpt‑oss models while
maintaining proper provider filtering.
The PR's safelyTruncateDocument() skips calling truncateDocument() when
there's nothing to truncate. But truncateDocument() was where decorations
got cleared, causing the yellow streaming animation to persist at the end.
Fix: Add onFinalUpdate() hook that's always called after the final update.
VscodeDiffViewProvider overrides it to clear decorations.
* fix: DiffViewProvider line boundary validation and content concatenation
Two bugs in DiffViewProvider caused file editing failures:
1. **Line boundary validation errors (#8423, #8429)**
JetBrains hosts using gRPC strictly validate line numbers. When
truncateDocument() was called with a line number >= document line count,
it caused "truncateDocument INTERNAL: Wrong line" errors. This occurred
when new content had >= lines than the original, making truncation
unnecessary but still attempted.
2. **Content concatenation on final update**
When replacing content without a trailing newline, the old content at
line N+1 was concatenated to the new content. For example, writing
"Hello World" to a file containing "line1\nline2\n" resulted in
"Hello Worldline2" instead of just "Hello World".
1. Added `getDocumentLineCount()` abstract method to all DiffViewProvider
implementations to query the current document line count.
2. Added `safelyTruncateDocument()` private helper that validates line
numbers before calling truncateDocument():
```typescript
private async safelyTruncateDocument(lineNumber: number): Promise<void> {
const lineCount = await this.getDocumentLineCount()
if (lineNumber < lineCount) {
await this.truncateDocument(lineNumber)
}
}
```
3. Extended the replacement range on final update to cover the entire
document, preventing content concatenation:
```typescript
const endLine = isFinal
? await this.getDocumentLineCount()
: currentLine + 1
```
- src/integrations/editor/DiffViewProvider.ts
- Added abstract getDocumentLineCount() method
- Added safelyTruncateDocument() boundary validation helper
- Modified update() to extend final replacement range
- src/hosts/vscode/VscodeDiffViewProvider.ts
- Implemented getDocumentLineCount() using editor.document.lineCount
- src/hosts/external/ExternalDiffviewProvider.ts
- Implemented getDocumentLineCount() by counting lines from getDocumentText()
- src/integrations/editor/FileEditProvider.ts
- Implemented getDocumentLineCount() from documentContent
- src/integrations/editor/__tests__/DiffViewProvider.test.ts (new)
- Added 4 unit tests for boundary validation and concatenation fix
Fixes#8423, #8429
* fix: preserve trailing newlines in file edits
Trailing newlines were being incorrectly stripped during file edits due to
trimEnd() calls in handlers. This caused files to lose their final newline
even when the original file had one.
Changes:
- Remove trimEnd() from WriteToFileToolHandler and ApplyPatchHandler that
was stripping trailing newlines before content reached the editor
- Remove dead code in DiffViewProvider.update() that tried to restore
newlines after the document was already written
- Add trailing newline fix-up in VscodeDiffViewProvider to handle VS Code's
applyEdit sometimes normalizing newlines on full-document replacements
- Fix FileEditProvider.replaceText() to preserve trailing newlines when
replacing to end of document
* fix: preserve trailing newlines in diff text ops
Align splitLines with JS split behavior and keep trailing
newline segments when replacing to end of document to avoid
dropping final line breaks.
Fixes#8004
When storage persistence fails (common on Windows with OneDrive/Dropbox/NAS),
the Controller was calling StateManager.reInitialize() to "recover". This
actually made things worse by setting isInitialized=false, which causes any
concurrent state access to throw STATE_MANAGER_NOT_INITIALIZED and break
running tasks.
The fix: just log the error. Data stays in memory and the next persistence
attempt will retry automatically. No need to alarm users with warnings since
nothing is actually lost.
Fix error message handling during streaming by removing previous partial
error messages and only pushing the final error result when streaming is
complete. This prevents multiple error messages from being displayed for
the same plan mode tool restriction and ensures errors are only finalized
after streaming ends.
* chore: enable APPLY_PATCH tool for native gpt-5 and codex variant
Replace FILE_NEW and FILE_EDIT tools with APPLY_PATCH for the native-gpt-5 model configuration that works better with codex and gpt-5 models
* Update changeset
* update snapshot
* Fix the Feature Flag null check
* Pass null instead of undefined
* Update the cacheInfo so we don't fetch twice simultaneously
* Fix the featureFlagsService binding
* refactor: rename VS Code LM API provider to GitHub Copilot
- Change dropdown label from "VS Code LM API" to "GitHub Copilot"
- Simplify description to focus on Copilot as the primary use case
- Remove experimental warning since the integration is stable
- Add link to Copilot extension in VS Marketplace
* fix: add font-size inherit to global anchor styles
Ensures links inherit font size from their parent element instead of
using a potentially different default size.
* Changed the "Notes" column for "Enable notifications" from "Helpful for terminal work" to "Accessible directly in the Auto Approve menu" to make it clear that users don't need to navigate to General Settings anymore.
Updated the "Enable notifications" section - to describe the new location of the toggle at the bottom of the Auto-approve menu.
A link to a short video showing the toggle was added.
* updated as per issue 7810 and noted in previous commit.
* edit - remove extra link to video in /auto-approve.mdx
---------
Co-authored-by: Juan Pablo Flores <juan@cline.bot>
#8335 introduced the use_skill tool, but there was no corresponding output in the chat interface (just an empty chat row).
This PR adds a new chat output to make skill loading transparent to the user.
* Fix local CLI install to rebuild cleanly
* fix(install): copy package.json for standalone startup
Ensure the extension package.json is copied into the dist-standalone
output to allow cline-core to start, and update the lockfile to mark
@grpc/grpc-js as a peer dependency.
* fix: keep diff view during apply patch approval
Stream patch parsing to render a diff view before approval step, and update file ops to avoid applying create/move/delete changes prematurely until request was approved.
* reset provider state after patch operations and improve file tracking
- Add provider.reset() call after user rejection to ensure clean state
- Move provider.reset() after successful patch application to prevent state leakage
- Defer file context tracking until after all patch operations complete
- Set didEditFile flag when processing results instead of during operations
This ensures the provider maintains a clean state between file operations and prevents potential issues with stale state affecting subsequent patches.
<budget:token_budget>200000</budget:token_budget>
* feedback
* feat: add auto-generation of state proto
Add lint-staged hook to automatically regenerate proto/cline/state.proto
when src/shared/storage/state-keys.ts changes. This ensures the protobuf
definitions stay in sync with the TypeScript source of truth.
Changes:
- Add generate-state-proto.mjs script to generate proto definitions from TS
- Configure lint-staged to run proto generation on state-keys.ts changes
- Update state.proto with regenerated field numbers and new OpenTelemetry fields
This automation prevents drift between TypeScript state definitions and
their protobuf representations, reducing manual maintenance burden.
* PlanActMode
* feat(proto): change thinking budget token fields to int64
Change plan_mode_thinking_budget_tokens and act_mode_thinking_budget_tokens
from int32 to int64 to support larger token budget values. Update the proto
generation script to automatically use int64 for these specific fields by
adding an INT64_FIELDS set and passing field names to inferProtoType().
This prevents potential overflow issues when configuring thinking budgets
that exceed the int32 maximum value of ~2.1 billion tokens.
* feat(proto): change auto_condense_threshold type from int32 to double
Changed the auto_condense_threshold field type from int32 to double in the
state.proto file to support decimal values. Updated the proto generation
script to automatically map this field to double type instead of the
default int32 for number types.
* add documentation for proto field generation
Add inline documentation to state.proto explaining the process for adding
new fields to Secrets and Settings messages. Also add a note in state-keys.ts
clarifying that the generate-state-proto.mjs script runs automatically on
commit. Remove redundant sync comment from API_HANDLER_SETTINGS_FIELDS.
* fix comment format
* open_ai_headers
* Remove the remote config auth listener
* Introduce a throttle RemoteConfigService
* Add changeset
* Change the interval to an hour
* Refactor
* Reintroduce comment and remove await
* Move the fetchRemoteConfig to the initTask function
* fix: remove error_retry when duplicate or retry succeeds
Improve error_retry message consolidation by:
- Removing duplicate error_retry messages, keeping only the latest attempt
- Removing error_retry messages entirely when followed by successful api_req_started
(unless marked as failed)
- Enhanced message lookahead logic to skip over api_req_retried messages when
determining what follows an error_retry
This provides cleaner message output during retry sequences and successful retry
recovery scenarios.
* add changeset
* only display last retry error
* add anthropic--claude-4.5-opus into sap provider.
Signed-off-by: Lize Cai <lize.cai@sap.com>
* add changeset
Signed-off-by: Lize Cai <lize.cai@sap.com>
---------
Signed-off-by: Lize Cai <lize.cai@sap.com>
- Change overflow-visible to overflow-hidden in CompletionOutputRow and PlanCompletionOutputRow to prevent content overflow issues
- Adjust inline code file path button alignment by removing vertical translation classes and adding inline display
- Improve icon positioning in MarkdownBlock by using inline and align-middle classes
These changes fix visual rendering issues where content was overflowing containers and buttons were misaligned in the chat completion output components.
- Add gpt-5.2-codex OpenAI model support
- Add create-pull-request skill
- Fix the selection of remotely configured providers
- Fix act_mode_respond to prevent consecutive calls
- Fix invalid tool call IDs when switching between model formats
Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
* fix: normalize tool call IDs for OpenAI messages
Transform tool call IDs to meet OpenAI length/prefix limits and apply the same logic to both `tool_calls[].id` and `tool_call_id` so they always match, preventing invalid parameter errors. Also enforce 53-char `fc_` IDs for the Responses API and add a helper to detect that format.
Ensure that whatever ID is produced for the tool_calls[].id in the assistant message matches what's produced for tool_call_id in the tool result message.
* add changeset
* refactor: move isOpenAIResponseToolId and fix tool ID truncation
- Move isOpenAIResponseToolId helper function from openai-response-format.ts
to openai-format.ts where it's actually used, making it private
- Fix transformToolCallId to use MAX_TOOL_CALL_ID_LENGTH constant for
calculating slice offset, ensuring IDs stay under the 40-char limit
- Add clarifying comment explaining the truncation logic
* fix: correct function call ID prefix check in OpenAI response format
Fix startsWith check to use "fc_" instead of "fc" to properly detect
* Fix tool call length
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
---------
Co-authored-by: Robin Newhouse <robin@cline.bot>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* Reduce the amount of sent banner requests
* Revert not fetching if no token is provided
* Remove redundant null
* Make a single call
* Make another request if forceRefresh is true
* Add a separate catch
* Allow switching between remote configured providers and only display valid providers
* Add changeset
* Return the provider set by the remote config
* Address comments
* Address comment
* Validate when updating settings
* Refactor
* Revert
* Use a more descriptive name
* Fix types
* Check we have remote configured providers, not only that the array is there
- Remove SystemPromptSection.MCP from Gemini-3 component order
- Disable feedback section in XS variant component overrides
- Update variant validator to allow disabled overrides without requiring them in componentOrder/tools list
The validator now correctly handles overrides with `enabled: false`, treating them as valid configuration even when the component/tool isn't included in the active lists.
- Add telemetry to track usage of skills feature
- Add version headers to Cline backend requests
- Phase in Responses API usage instead of defaulting for every supported model
- Fix workflow slash command search to be case-insensitive
- Fix model display in ModelPickerModal when using LiteLLM
- Fix LiteLLM model fetching with default base URL
- Fix crash when OpenAI-compatible APIs send usage chunks with empty or null choices arrays at end of streaming
- Fix model ID for Kat Coder Pro Free model
Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
* feat(ui): add new row components and unify ChatRow styling with tailwinds and lucid icons
- Add new ClineCompactIcon component for consistent branding
- Replace VSCode codicons with lucide-react icons for better consistency
- Browser session: SquareMousePointerIcon
- File operations: FilePlus2Icon, PencilIcon, SquareMinusIcon
- Terminal: TerminalIcon
- Loading states: LoaderCircleIcon
- Error states: CircleXIcon
- Extract ChatRow styles to separate CSS file for better maintainability
- Improve code block styling with theme-aware backgrounds and borders
- Update icon sizing and stroke weights for visual consistency
This change modernizes the UI by standardizing icon usage across components and improves code organization by separating styles into dedicated CSS files.
* feat(ui): integrate CompletionOutputRow and reasoning display in ChatRow
Updates the ChatRow component to support specialized rendering for task completion and model reasoning.
- Integrates `CompletionOutputRow` and `PlanCompletionOutputRow` for structured completion states.
- Adds `ThinkingRow` integration and props for handling `reasoningContent`.
- Updates `ChatRowProps` to include mode and request status tracking.
- Refines Storybook mocks to demonstrate reasoning steps and detailed completion results.
* feat(webview): group low-stakes tool executions in chat view
- Update `ChatView` to apply `groupLowStakesTools` to the message list, consolidating passive tool usage.
- Overhaul `MessageRenderer` to support rendering grouped tool messages with specific display info (icons, labels) for actions like `readFile`, `listFiles`, and `searchFiles`.
- Add logic to format search regex patterns for better readability.
- Implement utility checks for calculating costs and pending states within tool groups.
- This change reduces UI clutter by visually collapsing repetitive information-gathering steps.
* refactor(ui): update checkpoint control UI and restore menu
- Replace `VSCodeButton` with local `Button` component and use Lucide `BookmarkIcon`
- Migrate styled text components to utility classes for consistent styling
- Redesign the checkpoint restore popover to prioritize "Restore Files & Task"
- Add `showMoreOptions` state to manage menu visibility and interaction logic
* refactor(chat): rename CSS file for CompletionOutputRow
Renames `ChatRow.css` to `CompletionOutputRow.css` to align with the component naming convention. This change includes updating the import in `CompletionOutputRow.tsx` to reference the correctly named stylesheet.
* clean up PlanCompletionOutputRow
* clean up
* clean up
* update e2e
* update displayName
* fix blinking cursor position
* use classnames
* Completion notch
* clean up header class
* Move Command Output component to CommandOutputRow
* Fix shimmering animation
* update TypewriterText story title
* clean up notch style
* Seperate ToolGroupRenderer into individual component. Clean up styles and message utils.
* fix truncation display
* update styles for open file links
* apply feedback - fix CompletionOutputRow & ThinkingRow
* Display old Ask block for tools
* combine title and action buttons into CompletionOutputRow & PlanCompletionOutputRow
* remove animation from Cline icon
* update styles and animation
* adjust spacing
* Fix shimmering animation
* clean up
* clean up and simplify component styles
* clean up import names
* fix markdown block and use tailwind styles
* clean up spacing
* hide scrollbar
* remove expand handler
* cline logo position
* fix(chat): align logo to top in request progress indicator
Changed ClineLogoWhite component alignment from `self-end` to `self-start`
in the chat row's request progress view. This ensures the logo aligns to
the top rather than the bottom when displaying in-progress requests,
improving visual consistency with the adjacent message content.
* fix DiffEditRow title truncation
* Keep Cline logo for output text
* fix(chat): add invisible spacer for non-rendered rows
Replace `null` returns with an `aria-hidden` 1px spacer to keep chat row layout stable, and simplify summary header styling by moving inline styles into a className.
* update activity indicators and button styling for tool group
- Replace codicon with icon component for activity indicators
- Scale down Cline logo and remove border divider for cleaner layout
- Add disabled state styling to ThinkingRow button (cursor-text, full opacity)
- Fix TooltipTrigger by using asChild prop instead of disabled
- Adjust CheckmarkControl bottom margin for better alignment
These changes improve visual consistency and fix accessibility issues with tooltip triggers and button states.
<budget:token_budget>200000</budget:token_budget>
* revert: show cline logo during stream only
* remove streaming thinking title
* spacing
* apply feedback: remove border for thinking, fix overflow typewriter text
* fix(ui): align thinking text and reasoning content positions
- Add ml-1 margin to both thinking text and ThinkingRow for consistent left alignment
- Remove default button padding from ThinkingRow with p-0
* fix(ui): simplify ToolGroupRenderer and remove OptionsButtons top padding
- Remove collapse/expand functionality from ToolGroupRenderer (always expanded)
- Remove chevron icon and left-align summary text with file list
- Standardize font size to 13px for summary, icons, and file names
- Remove font-editor to use default font family
- Remove "Thinking:" prefix from tooltips
- Add padding and spacing for better visual hierarchy
- Remove top padding from OptionsButtons
* fix(ui): restore CodeAccordian padding and overflow
* fix(ui): reduce spacing between header and content text
* fix(ui): restore task completion buttons to original style
- Restore SuccessButton component
- Move buttons outside the green card
- Use SuccessButton for both View Changes and Explain Changes
- Full-width stacked buttons with proper spacing
* fix(ui): polish Task Completed and Plan Created card styling
- Remove hover border color change
- Fix last paragraph bottom margin
- Add proper top padding for header and content
- Add horizontal padding to header row
- Remove unnecessary conditional padding
* fix(ui): style tweaks for copy button and checkpoint label
- Make Task Completed copy button green to match header
- Reduce Checkpoint label font size to 9px
* fix(ui): prevent TypewriterText from jumping on completion
---------
Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
Add optimizeDeps configuration with force flag to ensure Vite
re-optimizes dependencies on every build. This resolves potential
issues with stale or inconsistent dependency resolution in the
webview build process.
* refactor: simplify API configuration management and state handling
Refactored `StateManager` and `ApiConfiguration` handling to use a more maintainable, data-driven approach. Replaced manual key mapping in `setApiConfiguration` with automated categorization based on static definitions.
- Updated `buildApiHandler` and `createHandlerForProvider` to accept `Partial<ApiConfiguration>`, improving flexibility.
- Introduced `categorizeApiConfigurationKeys` and other helpers to separate settings from secrets automatically.
- Centralized secret key definitions in `state-keys.ts` to reduce boilerplate and potential for errors when adding new providers.
- Cleaned up redundant imports and type definitions across the core API and storage modules.
* apply feedback
* clean up
* refactor: consolidate API configuration types and state key definitions
- Rename `ApiHandlerSecrets` to `Secrets` for consistency across codebase
- Merge `ApiHandlerOptions` with `ApiHandlerSettings` to reduce duplication
- Extract `GlobalStateAndSettingKeys` as a computed constant from state field definitions
- Consolidate remote configuration fields into `REMOTE_CONFIG_EXTRA_FIELDS` group
- Remove redundant type definitions and improve type safety in state management
This refactoring simplifies the type system by eliminating duplicate interfaces
and ensures consistent naming conventions throughout the storage and API layers.
* Clean up
* rename type with default
* type safe
* add unit test
* Apply suggestions from code review
Co-authored-by: Tomás Barreiro <52393857+BarreiroT@users.noreply.github.com>
* apply feedback
---------
Co-authored-by: Tomás Barreiro <52393857+BarreiroT@users.noreply.github.com>
* add requirements
* add requirements checklist
* feat: add logic (only) for enterprise to control local MCP config via remote config
* when allowlist is empty, allow all local servers; when a server is on allowlist, load regardless of whether from github
* fix comment, use Object.keys(remoteConfig).length to check if remote config is on or not
---------
Co-authored-by: Sarah Fortune <sarah.fortune@gmail.com>
* Fixed bugs within cline cli and removed extra console.log
* Removed old models from using Responses API
* Revertred last commit'
* Added changeset
---------
Co-authored-by: celestial-vault <58194240+celestial-vault@users.noreply.github.com>
* [NOOP] Update BannerService to integrate with the webview.
Update the BannerService to convert the banners to the BannerCardData format for the webview.
Add a field for the banners in the `ExtensionState`.
In the WelcomeSection, get the banners from the extension state and show them in the webview.
NOOP- this is a currently a no-op because the controller is not yet populating the `banners` field in the extension state. I will submit that in a second PR because we need the handlers for the dismissal logic before we can start displaying the banners.
# Conflicts:
# src/shared/ExtensionMessage.ts
* Update tests
* Validate the banner action type before sending it to the webview
* Handle dimiss for API banners
When an API banner is dismissed, use the `dismissBanner` protobus handler.
Add warning comments saying not to use the old banner version system. This not scalable as it requires a different protobus handlers for each type of banner. You can get the same effect by using the banner ID and appending a version number to the ID.
* Send the banners from the extension to the webview
The controllers populates the banners in the extension state.
Add a check for buttons with empty titles because they don't render properly and this is an error in the banner configuration if it happens.
* Add handler to Link action button in the webview.
* Fix handler for ShowApiSettings in the webview
* Made change to not allow old models to use Responses API
* Added changeset
* Removing oca from nextGenModelProvier so that we remove native tool calls for now
* Adding back oca as a nextGenModelProvider
* Prevent loop when getting user organization
* Do not restore user info if the org he is switching to is already active
* Add changeset
* Fix reference array
* Add field to settings and handle side effects
* Avoid fetching and applying remote config if it's disabled
* Refactor and apply configured org settings when the user opted out of another one he owns
* Refactor
Fix check
* Add toggle to the account view
* Add changeset
* Fix can disable remote config
* clean canDisableRemoteConfig
* fix: guard against null/empty choices in streaming responses
Some OpenAI-compatible APIs (DeepSeek, Groq, OpenWebUI, etc.) send
usage chunks at the end of streaming with empty or null choices arrays.
This was causing crashes with 'Cannot read properties of undefined'.
Added optional chaining on chunk.choices across all 24 affected
provider files to safely handle these usage-only chunks.
Fixes#8384
* chore: add changeset
Update Claude 3.5 Haiku model to support image processing as per
Anthropic API release notes.
Fixes#2009
Co-authored-by: Yuri Chukhlib <yurii.chukhlib@viber.com>
When the @ mention context menu shows "No results found" and the user
presses Escape, the menu was not closing because setShowContextMenu(false)
was not being called.
Fixes#5532
Co-authored-by: Yuri Chukhlib <yurii.chukhlib@viber.com>
Some LLM providers (notably Claude Sonnet 4.5 via VS Code LM API) insert
spurious spaces before file extensions (e.g., "file .ts" instead of "file.ts").
This fix adds heuristic normalization to remove spaces immediately before
file extensions while preserving legitimate spaces in filenames.
Fixes#7827
Co-authored-by: Yuri Chukhlib <yurii.chukhlib@viber.com>
Users can now find workflows regardless of letter casing (e.g., searching "/testhook" finds "Testhook").
Fixes#7834
Co-authored-by: Yuri Chukhlib <yurii.chukhlib@viber.com>
- Enable configuring an OTEL collector at runtime
- Removing Minimax-2.1 from free model list as the free trial has ended
- Improved image display in MCP responses
- Auto-sync remote MCP servers from remote config to local settings
Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
* feat(mcp): improve image display in MCP responses
- Truncate data URIs to show prefix + first 20 chars with [IMAGE] label
- Apply truncation in all display modes (rich, plain, markdown)
- Click data URI images to open in VS Code editor (like mermaid diagrams)
- Expand images to 100% width of response container
- Persist collapsed/expanded state per-response without syncing all instances
* fix(settings): remove Collapse MCP Responses setting from UI
The setting is now implicit - collapsing any MCP response saves the
preference for future responses. Removes confusing sync behavior
between the Settings toggle and individual response toggles.
* feat: add remote config sync with extension mcp marketplace for new remote servers
* refactor: extract getMcpSettingsFilePath into disk.ts to be reused
* refactor: rename helper method to avoid ambiguity
* address formatting suggestion by ellipsis-dev for the code itself that was moved
* refactor: add flag pattern to prevent race condition from triggering unnecessary watcher events
* fix: do not re-throw error
---------
Co-authored-by: Sarah Fortune <sarah.fortune@gmail.com>
* Replace process.env usage with a BUILD_CONSTANTS variable
* Update import
* revert doc update
* Enable configuring an OTEL collector at runtime
* Refactor
* Refactor
* Add changeset
* Do not build IS_STANDALONE
* Add comment
* Update the `.env.example` file
* Remove `true` from the selected options and revert env.example
* Use `true` for runtime variables
- Add Skills system for reusable, on-demand agent instructions
- Add new websearch tooling in Cline provider
- Add zai-glm-4.7 to Cerebras model list
- Add model refresh and improve reasoning support for Vercel AI Gateway
- Revert #8341 due to regressions in diff view/document truncation (see #8423, #8429)
- Fixed extension crash when using context menu selector
Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
* docs: add Skills feature documentation
Add comprehensive documentation for the Agent Skills feature including:
- Overview of what skills are and why they're useful
- How to create skills with SKILL.md and YAML frontmatter
- Global vs project skill locations
- Managing skills via the UI toggle interface
- Real example (data-analysis skill)
- Bundling supporting files and scripts
- Comparison with Rules and Workflows
Oh. Add a new Skills tab to the Rules/Workflows modal that allows users to
view and toggle skills (global and workspace), create new skills from
templates, and delete existing skills. The tab only appears when the
skillsEnabled setting is on.
Changes:
- Add proto definitions for skills operations (refreshSkills, toggleSkill,
createSkillFile, deleteSkillFile) with corresponding message types
- Add globalSkillsToggles to Settings and localSkillsToggles to LocalState
- Implement controller handlers for skills operations
- Add skills toggle state management to ExtensionStateContext
- Add Skills tab component to ClineRulesToggleModal
- Update RuleRow and NewRuleRow components to support skill type
- Implement lazy discovery for skills in UseSkillToolHandler (skills are
discovered on-demand at execution time and filtered by toggle state)
- Use Tailwind CSS classes for styling consistency
* fix: prevent duplicate diff error messages during file edits
Remove existing diff_error messages before displaying new ones to avoid
showing the same error multiple times when streaming file edits. This
ensures users only see the error once per occurrence, improving the UX
during tool execution with parallel tool calling disabled.
* Update src/core/task/tools/handlers/WriteToFileToolHandler.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Add experimental "Enable Skills" toggle in Settings > Features that
controls whether the Skills system is active. When disabled (default),
no directory scanning occurs and the use_skill tool is not exposed.
- Add skillsEnabled to Settings interface and ExtensionState
- Add skills_enabled to proto definitions
- Gate skill discovery in Task.attemptApiRequest()
- Add UI toggle in FeatureSettingsSection
feat(skills): add reusable Skills system and standardize global skills location
- Implement Skills system for reusable agent instructions loaded from project and global directories
- Support skill discovery and loading via stateless utilities
- Parse YAML frontmatter for skill metadata (name, description)
- Add use_skill tool for on-demand instruction loading
- List available skills in system prompt; global skills override project skills
- Define skills as directories with a SKILL.md file
- Add unit tests for skill utilities
- Global skills in ~/.cline/skills
- Introduce getClineHomePath() and update docs and tests for new path
* since npm nightly worked, make npm main
* fix ripgrep, split npm and jetbrains packaging
* cli nightly package version update
---------
Co-authored-by: Andrei Edell <andrei@nugbase.com>
* feat(vercel-ai-gateway): add model refresh and reasoning support
- Add refreshVercelAiGatewayModelsRpc to ModelsService for fetching models
- Fix model ID/info references to use Vercel-specific parameters instead of OpenRouter
- Add reasoning effort and Gemini thinking level configuration support
- Skip reasoning content for incompatible models (devstral, grok-4)
- Improve model selection UI with keyboard navigation (ArrowUp/Down/Enter)
- Add model refresh functionality to settings interface
This enables proper model discovery and improves reasoning capabilities for Vercel AI Gateway provider, while fixing incorrect parameter references that were using OpenRouter naming conventions.
* refactor
* refactor
* refactor
* refactor
* refactor
* feat: hide the delete server ui when user and the remote mcp server is managed by remote config
* feat: add message to user if they are managed by remote config
- Add zai-glm-4.7 to Cerebras model list\n- Update model metadata (context window + descriptions)\n- Update Cerebras provider docs\n- Include changeset for release notes
* Made changes for adding responses suppport
* removed some logs
* Made change to disallow format
* Added logging for cline
* Fixed codex prompts
* Made changes to make cline work
* Removed extra changes
* Added reasoning effort also to chat completions
* Made changes to fix issues with cline based on bugbash
* removed extra console.log statements
* Added extra changes to make reasoningEffortOptions working properly(outputs undefined)
* Made changes to code that make it cleaner
* created utility function for responses
* Removed extra console.log lines
* Fixed issues with tests not working
* Added changeset
* Update webview-ui/src/components/settings/providers/OcaModelPicker.tsx
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* removing openai-native changes
* Switched to using api format instead of supportsResponsesApi and supportChatApi
---------
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* feat: remove kwaipilot/kat-coder-pro from free models list
Remove the KwaiPilot KAT-Coder Pro model from the OpenRouter
free models picker, likely due to availability changes or
model deprecation.
* changes
- Added experimental support for Background Edits (allows editing files in background without opening the diff view)
- Updated free model to MiniMax M2.1 (replacing MiniMax M2)
- Added support for Azure based identity authentication in OpenAI Compatible provider and Azure OpenAI
- Add `supportsReasoning` property to Baseten models
- Prevent expired token usage in authenticated requests
- Exclude binary files without extensions from diffs
- Preserve file endings and trailing newlines
- Fix Cerebras rate limiting
- Fix Auto Compact for Claude Code provider
- Make Workspace and Favorites history filters independent
- Fix remote MCP server connection failures (404 response handling)
- Disable native tool calling for Deepseek 3.2 speciale
- Show notification instead of opening sidebar on update
- Fix Baseten model selector
- Modify prompts for parallel tool usage in Claude and Gemini 3 models
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Introduced a new feature, Background Edit, allowing file changes without opening the diff editor.
* Updated documentation to explain how to enable and use Background Edit, including its benefits and relationship with other features.
Updates the Minimax model identifier from `minimax/minimax-m2` to `minimax/minimax-m2.1` in the OpenRouter model picker configuration. Additionally, updates the Cline provider to ensure the new model version is correctly recognized as a free model for cost calculation purposes.
* feat(hooks): Initial implementation of UI output in the CLI
* feat(hooks): Display hooks UI output in the CLI nicely
* feat(hooks): Improvements to the hooks CLI implementation
* feat(hooks): Changes as per Cline's code review of hooks CLI PR
* feat(hooks): Make comments more concise and to the point
* feat(hooks): Minor improvements to code complexity
* feat(cli): polish hook status output (headers, paths, spacing)
- Align hook headings with ToolRenderer-style language
- Prefer workspace-relative paths for hook scripts
- Document hook_output_stream suppression + future grouping
- Add unit tests for rendering + path formatting
* feat(hooks): Isolate hook handlers and harden path handling
- Move hook-specific SAY handling into say_handlers_hooks.go
- Use os.UserHomeDir + filepath.Rel for more portable hook path shortening
- Document why hooks render from state stream (ordering/reordering)
- Standardize on filepath for filesystem paths in cline-clients
- Avoid silently ignoring os.Getwd() errors in dev fallback resolution
* feat(hooks): Add pendingToolInfo to hook status in the CLI
* feat(hooks): Fix verbose output to CLI
* feat(hooks): Add changeset commit.
* feat(hooks): code review feedback - make paths OS-agnostic
* feat(hooks): code review feedback - use strings.Builder
* feat(hooks): code review feedback - no need to normalize say type
* feat(hooks): code review feedback - define HookOutputStreamMeta type
* feat(hooks): code review feedback - remove dynamic import
* feat(hooks): code review feedback - turn repetitive logic into helper function and make say type names reflect proto field names
* feat(hooks): code review feedback - remove unrelated changes
* feat(hooks): prepend hook script path with repo name
* fix: sap provider - support replace credentials in orchestration mode without the need to reload vscode
* fix: sap provider - support replace credentials in orchestration mode without the need to reload vscode
* fix: sap provider - support replace credentials in orchestration mode without the need to reload vscode
* fix: sap provider - support replace credentials in orchestration mode without the need to reload vscode
* fix: sap provider - support replace credentials in orchestration mode without the need to reload vscode
* fix: sap provider - support replace credentials in orchestration mode without the need to reload vscode
* fix: sap provider - support replace credentials in orchestration mode without the need to reload vscode
* fix: sap provider - support replace credentials in orchestration mode without the need to reload vscode
* fix: sap provider - support replace credentials in orchestration mode without the need to reload vscode
* fix: sap provider - support replace credentials in orchestration mode without the need to reload vscode
* fix: sap provider - support replace credentials in orchestration mode without the need to reload vscode
* fix: sap provider - support replace credentials in orchestration mode without the need to reload vscode
* fix: sap provider - support replace credentials in orchestration mode without the need to reload vscode
* fix: sap provider - support replace credentials in orchestration mode without the need to reload vscode
* fix: sap provider - support replace credentials in orchestration mode without the need to reload vscode
* fix: sap provider - support replace credentials in orchestration mode without the need to reload vscode
* fix: sap provider - support replace credentials in orchestration mode without the need to reload vscode
* feat: support azure identity authentication
Signed-off-by: patst <patrick.steinig@googlemail.com>
* feat: support azure identity authentication
Signed-off-by: patst <patrick.steinig@googlemail.com>
* chore: format changes
* set azureIdentity in state
* ADD Openai Compat Azure AD managed identity support: added proto messages def for azure identity, updated OpenAI APi key missing if azure identity is checked, ...
* feat: Support Azure Identity DefaultCredential for AzureOpenAI (OpenAI Compatible provider)
* fixed azure identity version and missing state setting in proto
* added missing state setting in proto
---------
Signed-off-by: patst <patrick.steinig@googlemail.com>
Co-authored-by: patst <patrick.steinig@googlemail.com>
Co-authored-by: Wenceslas Wolfersperger <wenceslas.wolfersperger@idorsia.com>
* fix: sap provider - use messages_history field instead of messages because of placeholder_values usage templating error
* fix: sap provider - use messages_history field instead of messages because of placeholder_values usage templating error
* fix: sap provider - use messages_history field instead of messages because of placeholder_values usage templating error
* fix: sap provider - use messages_history field instead of messages because of placeholder_values usage templating error
* feat: add MiniMax model support for OpenRouter and Vercel AI Gateway
Add MiniMax M2, M2.1, and M2.1-lightning models to the list of models
that require special system prompt handling in OpenRouter stream.
Also extend Vercel AI Gateway to apply the same system prompt format
for MiniMax models as used for Anthropic models.
* adding changes with debug logs
* feat: add Select UI component and Storybook story
Add @radix-ui/react-select dependency and introduce a Select Storybook
story to document and validate the new dropdown UI component.
* update position
* feat(prompts): enable parallel tool usage for claude and gemini 3 models
- Update TOOL USE section to allow multiple independent tools per response
- Add rules clarifying when parallel vs sequential tool usage is appropriate
- Specify MCP operations should still be used one at a time
- Update test snapshots to reflect prompt changes
* Change prompts based on whether parallel tool calling is enabled
- GPT5 family: leave as is because parallel tool calling is always enabled
- Gemini 3 family: many or one tool depending on toggle
- Claude 4+ family: many tool or empty instruction to not collide with claude "under the hood" system prompt, which already suggests multi-tool use
* Revert non-parallel behavior to use working prompt.
Co-authored-by: Bee <68532117+abeatrix@users.noreply.github.com>
* feat: add MCP server checks with utility function
Add hasEnabledMcpServers() utility function to standardize MCP server detection across prompt variants. Conditionally include MCP-specific instructions only when MCP servers are enabled, avoiding unnecessary prompts when no servers are configured.
* Update prompt test snapshots
---------
Co-authored-by: Bee <68532117+abeatrix@users.noreply.github.com>
- Import @vscode/codicons CSS and font files in StorybookDecorator to ensure icons render correctly in the Storybook environment.
- Move the global `index.css` import from `preview.ts` to `StorybookDecorator.tsx` to consolidate style initialization.
Reverts the signature check from #8291 that dropped blocks without
signatures, restoring the fallback to GEMINI_DUMMY_THOUGHT_SIGNATURE
from #8122 to support transferring history from other models to Gemini.
* fix: Baseten model selector issue in ModelPickerModal
Fixed an issue where Baseten model cannot be selected when running in ModelPickerModal.
Refactor ModelPickerModal to reuse ThinkingBudgetSlider component
- Remove duplicated thinking budget slider UI components and logic
- Replace with shared ThinkingBudgetSlider component for consistency
- Clean up unused constants and helper functions
- Simplify provider-specific configuration handling
* clean up styled spans
* fix
* fix: add supportsReasoning property to Baseten models
- Add supportsReasoning field to model configurations in basetenModels
- Implement detection logic for reasoning support via supported_parameters
- Mark reasoning-capable models (DeepSeek-R1, Qwen3, etc.) with supportsReasoning: true
- Update model refresh logic to populate supportsReasoning based on static config or parameter detection
This fixes issues where Baseten models are showing Thinking not supported in the UI.
* add changeset
* simplify
* clean up
* typo
Cerebras rate limiter estimates token consumption using max_completion_tokens upfront, so requesting the model maximum (e.g., 64K) reserves that quota even if actual usage is low. This causes users to hit rate limits prematurely during agentic workflows with many short tool-use responses.
Uses 16K as default which is sufficient for most agentic tool use while preserving rate limit headroom.
Co-authored-by: Seb Duerr <sebastian.duerr@cerebras.net>
- Add MiniMax-M2.1 model with 192K context window and prompt caching
- Add MiniMax-M2.1-lightning variant with higher output pricing
- Update default model from MiniMax-M2 to MiniMax-M2.1
* fix(mcp): handle 404 responses from streamableHttp servers
The MCP SDK sends a GET request to check for SSE stream support when
connecting to streamableHttp servers. Per the MCP spec, servers that
don't support SSE should return 405 (Method Not Allowed), but many
servers incorrectly return 404 (Not Found).
The SDK only gracefully handles 405 responses, so servers returning 404
cause connection failures with "Failed to open SSE stream: Not Found".
This was exposed by the SDK upgrade from 1.22.0 to 1.25.1 in v3.46.0,
which added stricter SSE stream initialization checks.
This fix wraps the fetch function to normalize 404 -> 405 for GET
requests, allowing Cline to work with non-compliant servers while
they update to return proper 405 responses.
Fixes#8320Fixes#7577
* chore: add changeset
Only show a notification when the extension updates, instead of
automatically focusing the Cline sidebar. This prevents the extension
from stealing focus on VS Code launch.
When using background exec mode, commands run in the system default shell
(cmd.exe on Windows, /bin/bash on Unix) rather than the VS Code configured
shell. This ensures the system prompt accurately reflects which shell will
be used for command execution.
- Add getEffectiveShell() function to determine actual shell used
- Pass terminalExecutionMode through SystemPromptContext
- Use system default shell info when backgroundExec mode is active
Co-authored-by: Ara <arafat.da.khan@gmail.com>
Update command cancellation to modify existing message instead of sending new say() to avoid interfering with pending ask() dialogs.
- Extend updateClineMessage to support text updates
- Find last command_output message and append cancellation notice
- Add missing cleanupFileBased() calls for background tracking paths
- Use shared findLastIndex utility
Co-authored-by: Ara <arafat.da.khan@gmail.com>
* fix(api): filter Gemini reasoning details by tool call ID
Filter reasoning details in the OpenAI format transformer to ensure they
only include entries matching the specific tool call ID. This prevents
"Function call is missing a thought_signature" errors when using Gemini
models, where mismatched reasoning details would cause API validation
failures.
* fix(gemini): drop invalid thought signatures and corrupted reasoning_details
- Gemini direct: drop tool_use/thinking blocks when signature is missing
- OpenRouter: keep only tool reasoning_details matching tool id
- Skip reasoning.encrypted entries missing data to avoid 400s (#8214)
* fix(core): sanitize Gemini tool calls in OpenRouter stream
Gemini models require thought signatures for tool calls. When switching providers mid-conversation, historical tool calls may lack these reasoning details, causing subsequent requests to fail.
This change implements a filter for Gemini models that:
- Identifies assistant messages with tool calls but no reasoning details.
- Drops those tool calls while preserving textual content.
- Removes the corresponding tool response messages to maintain conversation integrity.
* fix: make Workspace and Favorites history filters independent
Move Workspace and Favorites filters out of the VSCodeRadioGroup into
their own container. This fixes the regression where selecting one filter
would prevent selecting the other, since VSCodeRadioGroup enforces mutual
exclusivity. The filters now work as independent toggles while maintaining
visual continuity with the sort options above.
Fixes#8289
* add changeset
* deep planning demo
* deep-planning-demo cleanup
* Update docs/features/slash-commands/deep-planning.mdx
Co-authored-by: Juan Pablo Flores <juan@cline.bot>
* Update docs/features/slash-commands/deep-planning.mdx
Co-authored-by: Juan Pablo Flores <juan@cline.bot>
---------
Co-authored-by: Juan Pablo Flores <juan@cline.bot>
Update terminal troubleshooting docs to prominently recommend
Background Execution Mode as the primary solution for terminal
integration problems. This provides a simpler fix for most users
before diving into more complex troubleshooting steps.
- Add tip boxes with step-by-step instructions for enabling
Background Exec mode in both terminal guide documents
- Clarify that detailed troubleshooting is for users who
specifically need VSCode's integrated terminal
* feat(telemetry): add terminal type tracking to telemetry events
Add terminalType parameter to terminal telemetry methods to differentiate
between VSCode and standalone terminal execution contexts. This enables
better analysis of terminal output capture success rates across different
environments.
- Add TerminalType, VscodeOutputMethod, and StandaloneOutputMethod types
- Update captureTerminalExecution to require terminalType parameter
- Update captureTerminalOutputFailure to require terminalType parameter
- Add terminalType option to OrchestrationOptions interface
- Update all call sites in VscodeTerminalProcess with "vscode" type
* feat(terminal): add terminal type tracking to telemetry events
Pass terminal type (standalone vs vscode) to telemetry capture calls
for terminal hang and user intervention events. This enables better
analysis of terminal behavior differences between execution modes.
* feat: add telemetry tracking for standalone terminal execution
Add telemetry capture for terminal process completion and errors in
StandaloneTerminalProcess to track execution success/failure metrics.
- Track successful completions (exit code 0 or null) and failures
- Capture error events separately with child_process_error identifier
- Use "standalone" terminal type for metric categorization
* feat: remove z-ai/glm-4.6 from free models list
Remove the Zhipu AI GLM-4.6 model from the free models selection in the OpenRouter model picker component. This change updates the available free model options for users.
* update changelog
- Added GLM 4.7 model
- Enhanced background terminal execution with command tracking, log file output, zombie process prevention (10-minute timeout), and clickable log paths in UI
- Apply Patch tool for GPT-5+ models (replacing current diff edit tools)
- Duplicate error messages during streaming for Diff Edit tool when Parallel Tool Calling is not enabled
- Banner carousel styling and dismiss functionality
- Typos in Gemini system prompt overrides
- Model picker favorites ordering, star toggle, and keyboard navigation for OpenRouter and Vercel AI Gateway providers
- Fetch remote config values from the cache
- Anthropic handler to use metadata for reasoning support
- Bedrock provider to use metadata for reasoning support
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
When the triage bot identifies a likely regression from a recent PR or
commit, it will now apply the "Regression" label to help the team
prioritize and route these issues to the responsible developer.
- Add glm-4.7 model configuration for both international and mainland ZAi
- Update default model from glm-4.5 to glm-4.7
- Add missing cacheReadsPrice property to glm-4.6 model configs
* refactor(terminal): centralize constants and implement output capping
- Move terminal-related constants (timeouts, compiling markers, and size limits) to a centralized constants file.
- Implement output capping in VscodeTerminalProcess to prevent memory exhaustion by truncating fullOutput when it exceeds MAX_FULL_OUTPUT_SIZE.
- Update terminal process logic to use centralized constants for consistency across VS Code and standalone terminal implementations.
- Clean up imports and formatting in the task core.
* update pricing
* fix(terminal): improve compilation marker detection accuracy
Extract compilation detection logic into isCompilingOutput() function
that checks markers at the START of lines only, rather than anywhere
in the output. This prevents false positives from file names, error
messages, or code snippets that happen to contain marker words.
* update pricing
* refactor(chat): simplify log file link display to show filename only
- Extract filename from full path for cleaner display
- Change from banner-style div to compact ghost button
- Add full path as tooltip for reference
- Improve styling with smaller text and border-based separator
* feat: add graceful process termination with SIGKILL fallback
Extract process termination logic into a reusable utility that handles
graceful shutdown:
- Send SIGTERM first to allow processes to clean up
- Wait for configurable timeout (default 2 seconds)
- Fall back to SIGKILL if process doesn't exit gracefully
- Support cross-platform termination via tree-kill
Update StandaloneTerminalProcess to use the new async terminate method
and update ITerminalProcess interface to allow async termination.
* feat(terminal): simplify compilation output detection to match markers anywhere
Change isCompilingOutput to use simple string includes() instead of
line-by-line startsWith() matching. This allows detecting compilation
markers anywhere in the output rather than only at the start of lines,
making detection more permissive and the code simpler.
* update pricing
* fix(ui): use theme-aware colors for shell integration warning banner
* fix(ui): improve log file path banner styling and wrapping
---------
Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
* feat: add SessionStart hook for Claude Code on the web
Adds a session-start hook that runs in remote environments to:
- Install all dependencies (npm run install:all)
- Generate gRPC/protobuf types (npm run protos)
This enables Claude Code web sessions to properly run tests and linters.
* feat: add .worktreeinclude for Claude Code worktrees
Ensures environment files and local settings are copied to new worktrees:
- .env files
- .clineignore
- Local Claude settings
* fix: include node_modules and generated files in worktreeinclude
Copying these to worktrees saves significant setup time:
- node_modules: skips npm install (~1-2 min)
- src/generated/, src/shared/proto/: skips proto generation
* feat: install gh CLI and add GITHUB_TOKEN support in session hook
- Rename session-start.sh to claude-code-for-web-setup.sh
- Install latest gh CLI from GitHub releases
- Check for GITHUB_TOKEN and inform Claude about gh availability
- Enables using `gh issue`, `gh pr` commands when token is configured
* refactor: make .worktreeinclude a symlink to .gitignore
When scrolled to bottom, the up button wasn't reliably scrolling all
the way to the top because Virtuoso's virtual rendering doesn't have
all items rendered. Added a delayed follow-up scroll to ensure we
reach the actual top after items render.
* fix(ui): center View All button under task history list
* fix(ui): use VSCodeRadio for workspace and favorites filters on history page
* fix(ui): move Select All/None buttons to bottom of history page with secondary style
* fix(ui): prevent MCP server toggle from triggering row expand/collapse
* fix(ui): show connecting status when enabling MCP server
* fix(ui): show connecting status during MCP server restart
* fix(ui): add cursor pointer on hover for expandable MCP server rows
Instead of auto-generating release notes from PRs, extract the
changelog entry for the version being released and append the
Full Changelog comparison link.
When starting a task in a location that can't use checkpoints (e.g., Desktop,
Documents, Downloads, or home directory), the checkpoint message was still
appearing in the chat without a SHA. This happened because the code added
the message before checking if initialization had failed.
Now we check for `checkpointManagerErrorMessage` before showing the checkpoint
message, so users in unsupported locations won't see a broken checkpoint element.
* Revert "feat: enhanced compact task complete ui (#8025)"
This reverts commit cc36c67fc9.
* feat(ui): add green styling to task completed row
- Add green border and tinted green background to task completion container
- Add copyButtonStyle prop to WithCopyButton for custom positioning
- Revert previous compact task UI changes in favor of simpler styling
* fix(mcp): resolve race condition when updating Cline-specific MCP settings
Fixes a bug where toggling auto-approve for MCP tools or changing timeout
settings would cause the UI to flash and revert, making the toggles appear
unresponsive.
The root cause was a race condition between two state update mechanisms:
1. RPC Response: Returns updated servers immediately to the webview
2. File Watcher: Detects the settings file change and triggers a second
update ~100ms later, potentially overwriting the first
Additionally, the file watcher was triggering full server restarts even
for settings changes that don't affect the MCP transport connection.
Changes:
- Add `isUpdatingClineSettings` flag to skip file watcher processing
when we're making internal settings changes
- Add `configsRequireRestart()` method to distinguish between settings
that require server restart vs Cline-specific UI settings
- Only notify webview when actual connection changes occur
- Update in-memory state for timeout changes without server restart
- Add comprehensive documentation for future Cline-specific settings
* chore: add changeset
* fix: update comments and sync all Cline-specific settings in-memory
* feat: add background edit mode with webview diff display
- Replace editor-based diff preview with webview DiffEditRow component
- Remove unused partialPreviewState and related methods from ApplyPatchHandler
- Integrate FileEditProvider in Task for background file edits when enabled
- Add comprehensive Storybook stories for diff edit row states
Test Plan:
1. Go to Features Setting to turn on `Background Edit`
2. Start a task that would perform file edits
3. Verify the diff edits will be performed in the background instead of stealing focus from your editor
4. Verify the new stories in Storybook for the new DiffEditRow components
* backgroundEditEnabled
* changeset
* clean up
* clear time out
* fix storybook
* refactor: banner system with data-driven architecture
Add new banner data structures and types to support a flexible, backend-driven
banner system. This enables dynamic banner management while maintaining
consistent UI rendering.
Changes:
- Add BannerCardData interface for banner configuration with support for icons,
severity levels, actions, and platform/user filtering
- Add BannerActionType enum defining action handlers (link, settings, CLI
install, model selection)
- Add BannerAction interface for button/link definitions
- Refactor banner rendering logic to use data-driven approach instead of
hardcoded implementations
- Update BannerCarousel component to handle new action types dynamically
This allows the backend to construct banner JSON that the frontend renders
consistently through the BannerCarousel component when ready.
* apply feedback
* update e2e test
* Add BackendBanner struct with converter
* clean up types
* clean up
- Remove hardcoded shouldEnableReasoning check in AwsBedrockHandler
- Use modelInfo.supportsReasoning from metadata to determine if reasoning should be enabled
- Update src/shared/api.ts to include supportsReasoning: true for all relevant Bedrock models (Claude 3.7, 3.5 Sonnet/Haiku, Opus, and 1m variants)
- Ensure consistency with other providers by keeping model capabilities in metadata
* feat: make banner providers filtering determined by what is selected instead of existing provider keys
* refactor: address feedback, use default case for string comparison
Add backgroundEditEnabled setting to global state and settings infrastructure.
This includes:
- Proto definition for the update settings request
- State management in controller and state helpers
- Extension state interface updates
- Default value of false in webview context
Building block for ENG-1367. Setting is not yet used in the UI or anywhere in the app yet. It will be done in the follow-up PR where the feature is implemented.
- Add error_level field to telemetry proto messages
- Move getConfiguration usage from core services to vscode hostbridge provider
- Remove migrateDisableBrowserToolSetting and migrateChromeExecutablePathSetting methods
- Remove direct vscode imports from core/task and services/browser
- Update getTelemetrySettings to retrieve and return telemetryLevel from vscode config
This refactoring centralizes vscode-specific configuration access in the hostbridge provider layer, improving separation of concerns and making core services less coupled to the vscode API. Plus the cline configurations has already been set to be empty in the package.json for vs code extension.
Add early return in WriteToFileToolHandler catch block when tool has
already failed once during streaming when enableParallelToolCalling is not enabled. This prevents the same error
message from being repeatedly added to userMessages array on each
new streaming chunk received.
* Refactor Anthropic handler to use metadata for cache_control behavior
Replace hardcoded switch statement with model.info.supportsPromptCache check, following the same pattern as OpenAI Native and Vertex providers.
* Refactor Anthropic handler to use metadata for reasoning support
Replace modelId substring checks with model.info.supportsReasoning flag, and add supportsReasoning: true to all models that support extended thinking (3-7, 4-, 4-5).
When YOLO mode is enabled and the maximum consecutive mistakes
threshold is reached, automatically fail the task instead of
waiting for user input. This prevents the task from hanging
indefinitely in automated/unattended scenarios.
Displays an error message suggesting to use a more capable model
and ends the task loop with a failure signal.
- Add check for yoloModeToggled flag to prevent waiting for user input
- Auto-respond with tool usage instructions when in yolo mode
- Log the auto-response action for transparency
- Maintain existing functionality for non-yolo mode operations
* Improve Model Picker Modal UI and provider persistence
* Replace fuzzy search with multi-word substring matching in model picker
* feat(model-picker): add thinking slider, provider dropdown portal, and UI improvements
- Add thinking budget slider with min/max constraints
- Render provider dropdown via portal with flip logic for positioning
- Add getProviderInfo helper for settings-only providers
- Use ArrowLeftRight icon for plan/act split toggle
- Close provider list when typing in search
- Fix selection backgrounds with linear-gradient layering
- Improve row heights and icon positioning
* refactor(model-picker): replace Fuse.js with multi-word substring search
---------
Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
Replaced the global `--disable-extensions` flag with specific
`--disable-extension` flags for `saoudrizwan.claude-dev` and
`saoudrizwan.claude-dev-nightly`. This allows testing the extension
under development alongside other installed extensions while
preventing conflicts with production or nightly versions of Cline.
* feat: replace diff edit tools with APPLY_PATCH tool for gpt-5+ with native tool calling
Replace FILE_NEW and FILE_EDIT tools with APPLY_PATCH in the native-gpt-5-1 variant configuratiob as that's the format the GPT 5 models are trained on.
* update snapshot
* Update ApplyPatchHandler UI and new line bug
* Remote configured OTEL
* Configure the OpenTelemetryTelemetryProvider for Remote Config and remove it when resetting the confiig
* Address comments
* Fix tests
* Refactor
* Address comments
* Refactor openTelemetryOtlpHeaders and add comment
---------
Co-authored-by: Sarah Fortune <sarah.fortune@gmail.com>
* docs: update multi-root workspace documentation for clarity and consistency
* docs: remove experimental label from multi-root workspace feature
Update documentation to reflect that multi-root workspaces are no
longer considered experimental while still noting the existing
limitations with Cline rules and checkpoints.
* docs: update multi-root workspace examples to clarify workspace config file locations
* docs: add guidance on using VSCode's files.exclude to manage generated folders in multi-root workspaces
---------
Co-authored-by: Tony Loehr <turingxo@gmail.com>
- Added Gemini 3 Flash Preview to the recommended models list in the OpenRouter model picker.
- Updated the "What's New" modal to announce the availability of the new model and provide a quick-start button.
* feat: add new model configuration
Add support for the new Gemini 3 Flash Preview model with reasoning
capabilities. Updates both vertex and gemini model configurations with
pricing, token limits, and thinking level settings.
* update pricing
---------
Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
* feat(model-picker): add tooltips to plan/act mode tabs
Show "Plan mode" and "Act mode" tooltips when hovering over the P and A
tabs in the split mode view of the model picker.
* fix(model-picker): remove focus outline from search input
* feat(model-picker): add checkmark to selected model and responsive provider
- Add checkmark icon on the right side of the selected model row
- Hide model provider name on viewports under 280px for better space usage
* fix(model-picker): remove double hover dim on provider row
* fix(model-picker): improve provider list styling consistency
- Reduce vertical padding to match model list rows
- Move checkmark to right side
- Use consistent font size
* fix(modals): add consistent arrow pointers to all popup modals
- Refactor ServersToggleModal to use same fixed positioning as other modals
- Add arrow pointer to ModelPickerModal
- Fix arrow z-index (1001) to seamlessly cover modal border
- Add viewport resize handling to ModelPickerModal for arrow repositioning
- Consistent styling across all three popup modals
* refactor(modals): unify modal styling and structure across components
- Introduce ModalContainer component for consistent styling in ServersToggleModal and ClineRulesToggleModal
- Simplify modal structure by removing unnecessary fragments and applying consistent fixed positioning
- Enhance arrow pointer implementation for better visual alignment across all modals
- Ensure responsive design and maintainability with updated styled components
* fix(modals): align modal widths with chat content and fix z-index
- Reduced modal inset from 15px to 10px to match chat content width
- Lowered modal z-index from 1000 to 49 so tooltips appear on top
- Adjusted modal positioning for consistency across all three modals
* fix(model-picker): update icon usage and tooltip content for thinking and split modes
- Replace Sparkles icon with Brain for extended thinking toggle
- Update tooltip messages to reflect current functionality for thinking and split modes
- Adjust padding in provider list item for better alignment
- Add min-height and box-sizing to search container for improved layout
* fix(model-picker): improve row heights, icons, and selection backgrounds
- Add min-height to search container for consistent row sizing
- Increase provider list padding from 4.5px to 6px
- Swap icon positions and use ArrowLeftRight for plan/act split toggle
- Fix transparent selection background on some themes using linear-gradient
* fix(model-picker): close provider list when typing in search
* fix(modals): adjust modal positioning
* refactor(modals): extract shared PopupModalContainer component
Consolidates duplicated modal container styling into a reusable component.
Removes ~130 lines of redundant code across ModelPickerModal, ServersToggleModal,
and ClineRulesToggleModal.
- Add side spacing for small viewports (calc(100%-2rem) instead of w-full)
- Apply rounded corners at all viewport sizes (not just sm:)
- Remove redundant "NEW" badge (title already says "New in v...")
- Remove redundant "Dismiss" button (X close button is sufficient)
- Reduce excess bottom padding for tighter layout
- Add cursor-pointer to dialog close button for better UX
- Clean up unused imports (PLATFORM_CONFIG, PlatformType, isVscode)
GLM models output thinking content in text tags when reasoning is enabled, which is not currently supported by the UI. Disabling reasoning for these models ensures cleaner output.
* fix: restore local MCP server connections blocked by enterprise config logic
The enterprise MCP allowlist feature (commit 3409fa744) inadvertently
blocked all local stdio-based MCP servers for regular users.
The bug: the validation logic applied enterprise restrictions to everyone
by default, when it should only apply when enterprise config is present.
* chore: add changeset
- Add snapshot file for native tools returned by system prompt getter function
- Remove inline comment from test:unit npm script that was breaking the command "npm run test:unit -- --update-snapshots"
Introduces a "Value or Provider" pattern to tool specifications, allowing the `instruction` field to be either a static string or a function of `SystemPromptContext`. This enables dynamic configuration of tool prompts based on runtime context (e.g., user settings) without hardcoding logic in the prompt builder.
- Updated `ClineToolSpecParameter` to support `string | ((context) => string)`
- Added `resolveInstruction` helper to handle dynamic resolution
- Refactored `PromptBuilder` to resolve instructions using the current context
- GLM-4.6
- kat-coder-pro
- Add parsing of env variable patterns to the mcpconfig.json
- TLS Proxy support issues for VSCode
- Add supportsReasoning flag to OpenAI reasoning models
- Fix thinking not available for some models in the OpenAI provider
- Fix invalid signature field issues when switching between Gemini and Anthropic providers
- Extract OpenRouter model filtering into reusable utility and use it in different model pickers
- Fix a11y for auto approve checkbox
- Improve ModelPickerModal provider list layout
- Migrate WhatsNewModal to new shared dialogue component
Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
* docs: update explanations for Explain Changes feature and command in VS Code
* fix: update Enterprise card link to point to the correct overview page
- this will help the community to onboard to the CLI quicker and me more
open to contributing to it.
Co-authored-by: Max Paulus 🥪 <max@cline.bot>
Co-authored-by: Tony Loehr <turingxo@gmail.com>
- Add Zhipu AI's GLM-4.6 agentic coding model as a free option
- Add KwaiKAT's KAT-Coder Pro model as a free option
- Update filter to preserve kat-coder-pro in Cline provider model list
The IS_STANDALONE environment variable is statically rewritten to
"true" or "false" strings by esbuild. Using a truthy check caused
"false" to be evaluated as true, incorrectly enabling the standalone
proxy configuration.
* feat(webview): migrate WhatsNewModal to new shared component
- Add @radix-ui/react-dialog dependency
- Replace custom modal implementation with Radix Dialog primitives
- Remove commented-out code and unused imports
- Update Storybook stories to include showAnnouncement state
- Add version to mock state for stories
The new Dialog UI component allows us to reuse the component with unified behavior and styles if needed
* replace deprecated VS Code toolkits component with shared components
* Clean up Modal component
* clean up
- Add dummy thought signature fallback for Gemini API when signature is missing
- Filter out thinking blocks without signatures before sending to Anthropic API
- Update signature field cleaning to apply to non-thinking blocks only
- Remove unused DEFAULT_CACHE_TTL_SECONDS constant
This ensures proper message conversion between providers by using Gemini's
documented dummy signature "skip_thought_signature_validator" when original
signature is unavailable, and prevents invalid thinking blocks from being
sent to Anthropic's API which requires valid signatures.
Move provider list inside scrollable container and hide model content
when provider list is expanded. This improves UX by preventing layout
overflow and providing cleaner visual separation between provider
selection and model browsing states.
* feat: add ability for enterprise to disable user from adding MCP servers via remote config
* use a proper type check instead of an as any assertion
* feat: check remote mcp server url against user configured mcp server and do not parse servers not on the allow list if no personal server allowed
* feat: Enforce remote config's local MCP market place settings and filter by allowlist and source (#8068)
* feat: add parse/load enforcement for local mcp market place servers
---------
Co-authored-by: Sarah Fortune <sarah.fortune@gmail.com>
* feat(hooks): Add telemetry for hooks
feat(hooks): Simplify hooks telemetry implementation and improve safety
feat(hooks): Changes as per Cline's code review
* feat(hooks): Changes as per PR feedback.
* fix: auto approve screen reader a11y
prevoius impl contained 2 tab stops per checkbox and read a generic
"Checkbox" label when focues on the checkbox input. This can be
confusing for a visually impaired person using a screen reader
* chore: changeset
* chore: remove unused imports
---------
Co-authored-by: CandiedUniverse <132302818+candieduniverse@users.noreply.github.com>
- Expose `getAvailableSlashCommands` rpc endpoint to UI clients
- Made slash command menu and context menu accessible and screenreader-friendly
- Made expanding/collapsing UI components accessible
- Model identity and routing for devstral-2512 free model
- Extension pricing/UI bug where extension incorrectly shows zero price for devstral-2512
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* fix: update OpenRouter model ID and filter logic for devstral-2512
- Update the model ID for devstral-2512 to include the ':free' suffix
- Modify the filter logic in providerUtils to handle devstral-2512 models
and ensure they are not excluded when using the Cline provider
- Also ensure the default OpenRouter model is preserved in the filter
* Mistral change
* Mistral change
* Mistral change
* accessibility: screen reader support for slash and context menus
* remove unnecessary selection announcement
* changeset run
* chore: clear announcement to avoid interfering with dom queries
* chore: resolve conflict
* refactor: move terminal integration from core to vscode host
- Relocate terminal-related code from core/integrations to hosts/vscode/terminal
- Move TerminalManager, TerminalProcess, TerminalRegistry, and related utilities
- Update import paths across the codebase to reference new locations
- Remove unused shellIntegrationWarningTracker and shouldShowBackgroundTerminalSuggestion from Controller
- This change better separates VSCode-specific terminal handling from core logic
* Mistral change
* refactor: consolidate terminal types into types.ts
- Move ActiveBackgroundCommand, AskResponse, CommandExecutorCallbacks, CommandExecutorConfig from ICommandExecutor.ts to types.ts
- Move OrchestrationOptions, OrchestrationResult from CommandOrchestrator.ts to types.ts
- Delete ICommandExecutor.ts (all types now in types.ts)
- Update imports in CommandExecutor.ts, CommandOrchestrator.ts, index.ts, and src/core/task/index.ts
- types.ts is now the single source of truth for all terminal-related types
* refactor: consolidate ITerminalProcess into types.ts
- Move ITerminalProcess, TerminalProcessEvents from ITerminalProcess.ts to types.ts
- Delete ITerminalProcess.ts (all types now in types.ts)
- Update imports in VscodeTerminalProcess.ts, StandaloneTerminalProcess.ts
- Update exports in index.ts
- types.ts is now the single source of truth for ALL terminal-related types
Close the modal automatically when users click "Try Devstral" or
"Try GPT-5.2" buttons to improve UX flow. Also update Devstral
button text to clarify it's free.
- OpenAI GPT-5.2
- Devstral-2 `devstral-2512` (formerly stealth model "Microwave")
- Improvements to chat modal model picker
- Amazon Nova 2 Lite
- DeepSeek 3.2 to native tool calling allow list
- Responses API support for Codex models in OpenAI provider (requires native tool calling)
- Xmas Special Santa Cline
- Welcome screen UI enhancements
- Initial checkpoint commit now non-blocking for improved responsiveness in large repositories
- Gemini Vertex models erroring when thinking parameters are not supported
- Restrictive file permissions for secrets.json
- Ollama streaming requests not aborting when task is cancelled
- OpenAI provider to centralize temperature configuration and include missing GPT-5 model settings
- OpenAI native handler to use metadata for model capabilities
- Vertex provider to use metadata for model capabilities
Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
* feat: add inline model picker modal
* fix: add together to SETTINGS_ONLY_PROVIDERS, remove sapaicore
* Fix bedrock thinking support and add together to dynamic providers
---------
Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
Previously, tool results were tracked using the tool name as a key. This caused a critical bug during parallel tool execution: if the same tool (e.g., `read_file`) was called multiple times in a single turn, subsequent calls would overwrite the previous ones in the `toolUseIdMap`. This resulted in missing tool results for all but the last call.
This commit changes the tracking mechanism to use the unique `call_id` provided by the LLM as the key. This ensures that every tool call is tracked independently, regardless of the tool name.
Specific changes:
- Updated `toolUseIdMap` in `Task.ts` to store `call_id -> tool_id` instead of `tool_name -> tool_id`.
- Updated `ToolResultUtils.ts` to retrieve tool IDs using `block.call_id`.
- Removed legacy MCP-specific logic that manually mapped the generic `use_mcp_tool` name to an ID. This is no longer necessary (and would be incorrect) as MCP tools now also use the robust `call_id` tracking, enabling parallel execution for them as well.
* feat: add experimental parallel tool calling support
Add a new experimental setting that allows models to call multiple tools
in a single response. This is automatically enabled for GPT-5 models.
- Add enableParallelToolCalling setting (off by default)
- Conditionally enforce didAlreadyUseTool flag based on setting
- Move checkpoint from per-tool to per-response
- Add UI toggle in Feature Settings section
* feat: enable parallel tool calling for GPT-5 in prompts and API (#8028)
* feat: enable parallel tool calling for GPT-5 in prompts and API
Update system prompts for GPT-5 and next-gen variants to instruct
models they may use multiple tools in a single response for independent
operations.
Fix OpenAI API to send parallel_tool_calls: true for GPT-5 models,
which was previously hardcoded to false for all models.
Related: #8020
Changes:
- Updated 5 prompt variant files to allow parallel tool use
- Added enableParallelToolCalls param to getOpenAIToolParams()
- Updated openai-native.ts to enable for GPT-5 model family
* Update system test snapshots for parallel tool calling
* Revert changes to MCP prompts
---------
Co-authored-by: Robin Newhouse <robin@cline.bot>
* feat: Added Devstral 2 Models
* feat(mistral): fix proxy support and add new model definitions
- Fix HTTPClient fetcher to properly extract URL and options from Request
objects, enabling proxy support in standalone mode (JetBrains/CLI)
- Add duplex option for body streams required by Node.js/undici
- Rename devstral-small-latest to labs-devstral-small-2512
- Add mistral-large-2512 model (256K context, $0.5/$1.5 pricing)
- Add ministral-14b-2512 model (256K context, $0.2/$0.2 pricing)
---------
Co-authored-by: omercelik <omercelik@users.noreply.github.com>
The Claude Code CLI returns tool arguments as complete objects, but the
StreamResponseHandler expects string chunks for streaming. This caused
tool calls to fail with "missing parameter" errors because the object
was being concatenated with a string, resulting in "[object Object]".
This change stringifies the tool arguments in the Claude Code provider
before yielding them, ensuring they are correctly parsed by the
StreamResponseHandler.
* enterprise docs
* tested for accuracy
* Reorganize Enterprise docs structure
- Consolidate member management under team-management/
- Unify all configuration under configuration/ with two clear paths:
- remote-configuration/ for simple cloud-based setup
- infrastructure-configuration/ for advanced enterprise features
- Create comprehensive overview pages explaining the differences
- Update all internal links to reflect new paths
- Preserve all existing content while eliminating redundancy
- Maintain clear separation between admin and member documentation
* removed trailing backslash
* fix docs.json
* enterprise docs reformat
* monday update
* tidied up managing members section
* fixed deployment guide
* simplify rules
* workflow cleanup
* rules tweak
* Update docs/enterprise-solutions/configuration/overview.mdx
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* fix other features
* fixed provider docs
* fixed monitoring
* fix providers
* updated cta and rbac
* fix enterprise overview
* enterprise-docs
* hid self-hosted section for now
* addressed format fixed
* docs: restructure monitoring navigation and move telemetry
- Remove unnecessary OpenTelemetry dropdown wrapper in Enterprise navigation
- Move Cline Telemetry from control-other-cline-features to monitoring section
- Update all internal documentation links to new telemetry path
- Simplify Control Other Cline Features section to focus on Yolo Mode only
- Group related monitoring features (overview, telemetry, opentelemetry) together
This creates a more cohesive navigation structure where telemetry-related
features are adjacent and eliminates unnecessary nested dropdowns.
* docs: rename Basic Telemetry to Cline Telemetry and add link
- Rename all instances of 'Basic Telemetry' to 'Cline Telemetry' for consistency
- Add href link to Cline Telemetry card in Monitoring Options section
- Update section headings and subheadings to use 'Cline Telemetry'
- Ensures consistent naming across monitoring documentation
* docs: restructure Enterprise YOLO Mode to focus on administrator controls
- Change title from 'Yolo Mode' to 'YOLO Mode' for consistency
- Add reference link to /features/yolo-mode for general documentation
- Remove duplicate content about basic YOLO Mode functionality
- Focus exclusively on Enterprise administrator configuration and controls
- Add comprehensive policy recommendations by organization size
- Include security implications, monitoring requirements, and compliance considerations
- Provide detailed technical implementation guidance
- Update overview.mdx card description to reflect enterprise focus
* docs: hide self-hosted/infrastructure configuration references
- Remove choosing-your-deployment from Enterprise navigation
- Remove self-hosted references from enterprise-solutions/overview.mdx
- Remove self-hosted comparison and warning from remote-configuration/overview.mdx
- Remove Info boxes linking to infrastructure config from provider pages (AWS, Google, LiteLLM)
- Remove Self-Hosted OpenTelemetry Collector section from opentelemetry.mdx
- Remove self-hosted deployment section from control-other-cline-features/overview.mdx
All self-hosted/infrastructure configuration documentation remains intact but is no longer
navigable or linked from SaaS provider configuration pages. This allows easy restoration
when features become available.
* clarified domain and seat info
* fixed getOpenTabs function
* Update getOpenTabs.ts
* Update package.json
* Revert package-lock files to main
---------
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: Juan Pablo Flores <juan@cline.bot>
* fix: prevent logout on network errors during token refresh
When network errors occur at startup (e.g., opening laptop while offline),
users were being logged out because the token refresh failed and returned
null to AuthService.
Now on network errors or max retries exceeded, we return the stored auth
data instead of clearing the session. This keeps users logged in with
their existing credentials. If the token is truly invalid, the actual API
request will fail later when the user tries to use Cline, rather than
logging them out preemptively at startup.
* chore: add changeset
This change removes hardcoded switch statements in VertexHandler and moves model-specific configurations (like reasoning support and prompt caching) into the centralized model metadata in src/shared/api.ts.
Benefits:
- Decouples handler logic from specific model IDs
- Centralizes model capabilities for easier maintenance
- Simplifies adding future Vertex models
- Improves type safety
Related: ENG-1408, ENG-1385
* feat: hide whats new modal header image for now
* feature: change set
* feat: xmas special santa cline
* fix: minor change to actual svg
* Fix colors
---------
Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
* fix: make initial checkpoint commit non-blocking while preventing tool execution races
- Captures the initial checkpoint commit promise in the Task class
- Ensures executeTool waits for the initial commit to complete before running any tools
- Resolves race condition where tools could modify files before the initial state was fully captured
* feat: allow read-only tools to bypass initial checkpoint block
- Defines READ_ONLY_TOOLS allowlist in shared/tools.ts
- Updates Task executor to check tool name against whitelist
- Allows exploration tools (list_files, read_file, browser_action, etc.) to run in parallel with initial commit
- Maintains blocking for state-modifying tools (write_to_file) to ensure data integrity
* feat(banners): add dismiss functionality to banner carousel
- Add onDismiss callback to BannerData interface
- Implement dismiss button (X icon) in BannerCarousel component
- Add onDismiss handlers for info, model, and CLI banners
- Update banner version in state when user dismisses a banner
- Fix carousel index bounds handling when banners are removed
- Refactor carousel handlers with useCallback for better performance
* Fix imports
* feat(banners): show dismiss X only on last card in carousel
* feat(hooks): Implement PreCompact hook
feat(hooks): Continuing implementation of PreCompact hook
feat(hooks): PreCompact supports contextModification
Fixes as per Cline code reviewing the PreCompact implementation
feat(hooks): Tweaking the PreCompact hook behavior while testing
feat(hooks): Implement PreCompact hook in handleContextWindowExceededError code path
feat(hooks): Implement conversation history temp file in task directory for PreCompact to access
feat(hooks): Implement context window temp file in task history directory for PreCompact to access
feat(hooks): Refactor complex function into helpers
* feat(hooks): Improvements from Cline code reviewing the change set
feat(hooks): Refactor duplicate logic into common utility function
feat(hooks): Improve compaction strategy naming
feat(hooks): Deduplicate a small piece of logic
feat(hooks): DRY for getNextTruncationRange()
feat(hooks): Fix contextModification for PreCompact hook
feat(hooks): Improvements as per Cline's code review feedback
feat(hooks): Improving code quality/reduce complexity
feat(hooks): Further code improvements as per Cline code reviewing
* feat(hooks): Changes as per PR feedback
* Prevent multiple simultaneos refreshes when retrieving auth info
* refactor
* Track logout events
* Add changeset
* Persist the startedAt date
* Fix bug
* Use snake case for event properties
* Log failed refresh request information
* feat(cli): Add hooks_enabled support to CLI settings
- Add hooks_enabled field to Settings proto message (field 134)
- Add hooks_enabled parsing to CLI settings parser
- Enables users to toggle hooks via -s hooks_enabled=true/false flag
Fixes missing CLI support for hooks that was available in the VSCode extension
* feat(hooks): Enable hooks in the CLI
* Add include back in after resolving merge conflict
* feat(hooks): Changes as per human code review feedback.
---------
Co-authored-by: NightTrek <Daniels@dual4t.com>
* Add the cline distribution type to the telemetry
In the telemetry we currently have the IDE name, but because there are so many variants of VSCode and JetBrains, it's not easy to group them by VSCode extension or JetBrains plugin. Add this field to the telemetry.
* update unit tests
* Update src/services/telemetry/TelemetryService.ts
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* Update src/services/telemetry/TelemetryService.ts
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
* Update unit tests
---------
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
This change removes hardcoded switch statements in OpenAiNativeHandler and moves model-specific configurations (like streaming support, system role, and tools support) into the centralized model metadata in src/shared/api.ts.
Benefits:
- Decouples handler logic from specific model IDs
- Centralizes model capabilities for easier maintenance
- Simplifies adding future OpenAI models
- Improves type safety with updated getModel() signature
Related: #7920
* implementing prompt injection for web_search and associated web fetch handler
* remove printing of the ms took
* ui showing query user is searching for
* updating the fields we pass in api request
* updating text for search tool
Move VSCode terminal impls into the src/hosts/vscode package. The VSCode specific code needs to be contained in this directory.
The `src/shared` package is for things shared with the extension and the _webview_; everything in src/ that's _not_ under `src/hosts` is shared with VSCode, JB, CLI implicitly.
ref CLIENTS-34
* feat(terminal): add shared terminal types and interfaces
Add shared terminal module with types and interfaces that enable
terminal management across VSCode, CLI, and JetBrains environments.
- Define ITerminal, ITerminalManager, and TerminalInfo interfaces
- Add TerminalProcessResultPromise for async command execution
- Include StandaloneTerminalOptions for non-VSCode environments
- Prepare module structure for standalone implementations
* feat(terminal): export standalone terminal implementations
Enable exports for standalone terminal classes that were previously
commented out as placeholders:
- StandaloneTerminal
- StandaloneTerminalManager
- StandaloneTerminalProcess
- StandaloneTerminalRegistry
These implementations are now ready for use outside the terminal module.
* fix: resolve TerminalInfo type incompatibility in settings update
- Remove unused TerminalInfo import from both updateSettings files
- Use `as any` cast to handle type mismatch between VSCode and standalone TerminalInfo
- Replace busyTerminals array with busyTerminalsCount to avoid type issues
- Add null-safe access when getting busy terminals length
* feat: import StandaloneTerminalManager from bundled cline-core
Replace standalone enhanced-terminal.js with import from the bundled
TypeScript version in cline-core.js. This consolidates terminal
management code and removes the need to separately include the
runtime file in the VS Code extension package.
- Re-export StandaloneTerminalManager from cline-core.ts
- Update vscode-impls.js to import from cline-core.js
- Remove .vscodeignore exception for enhanced-terminal.js
* feat: simplify standalone terminal manager initialization
Replace global injection pattern with environment variable detection
for determining terminal execution mode. The Task class now directly
instantiates StandaloneTerminalManager when IS_STANDALONE=true instead
of relying on a globally injected instance.
- Remove StandaloneTerminalManager re-export from cline-core.ts
- Simplify vscode-impls.js createTerminal to return stub object
- Use IS_STANDALONE env var for terminal manager selection in Task
- Remove global.standaloneTerminalManager injection pattern
* Fix Standalone build
* Fix Standalone build
* fix: use subagentTerminalOutputLineLimit in StandaloneTerminalManager.processOutput
Match the VSCode TerminalManager logic to properly use subagentTerminalOutputLineLimit (2000) for subagent commands instead of always falling back to terminalOutputLineLimit (500).
* feat: add TerminalManager to HostProvider for dependency injection
- Add TerminalManagerCreator type and createTerminalManager to HostProvider
- Extract ITerminalManager interface to shared/terminal/types for abstraction
- Refactor TerminalManager to implement ITerminalManager interface
- Create StandaloneTerminalManager for non-VSCode environments
- Update TerminalRegistry to use ITerminalManager via HostProvider
- Enable terminal management to work across different host environments
* feat: refactor terminal manager to use ITerminalManager interface
- Replace concrete TerminalManager/StandaloneTerminalManager types with ITerminalManager interface
- Use HostProvider.createTerminalManager() for host-agnostic terminal creation
- Simplify terminal execution mode logic in Task constructor
- Add dynamic imports for StandaloneTerminalManager when backgroundExec mode is used
- Improve logging for terminal manager selection
Add validation to ensure native tool calling is enabled when using
OpenAI Responses API format. Previously, the code would silently fall
back to completion stream when tools were not provided, which could
lead to unexpected behavior.
- Add explicit error when tools are missing for Responses API format
- Update tools parameter type to non-optional in createResponseStream
- Split shell commands to avoid parsing issues with parentheses in author names
- Clarify that hotfixes always use patch version bumps
- Add (hotfix) suffix to release notes commit message format
- Skip npm install step (automation handles lockfile)
- Add pbcopy step to copy tag to clipboard for GitHub Actions
- Add direct link to publish workflow
Add a workflow for creating hotfix releases by cherry-picking commits
from main onto release tags. Includes steps for selecting commits,
creating release notes, version bumping, and tagging.
The taskMetrics.totalCost was incorrectly initialized to 0 instead of
undefined in commit 09692d7d3. This broke cost display for providers
like Anthropic that don't return totalCost in their usage chunks.
When totalCost is 0, the fallback to calculateApiCostAnthropic() in
updateApiReqMsg doesn't trigger because the nullish coalescing operator
(??) only falls back for null/undefined, not 0.
By initializing totalCost to undefined:
- Providers that return totalCost (like OpenRouter) use that value
- Providers that don't (like Anthropic) fall back to calculating cost
from token counts and model pricing info
* refactor: Move OpenAI temperature to model metadata
- Added `temperature` field to `openAiNativeModels` in `api.ts`.
- Updated `OpenAiNativeHandler` to use `model.info.temperature` instead of hardcoded values in switch cases.
- This allows for centralized configuration of model temperatures.
* refactor: Consolidate OpenAI native streaming logic
- Simplified `createCompletionStream` in `OpenAiNativeHandler` by consolidating duplicated logic for streaming models (`gpt-5`, `o3`, `o4`).
- Introduced `systemRole`, `includeReasoning`, and `includeTools` flags to handle model-specific configurations.
- Preserved distinct handling for non-streaming `o1` models.
* cleanup recovering by removing unnecessary recursion; rename parameter for reconstructTaskHistory for clarity, and add stdout logging in error blocks
* Don't return empty array on IO error. Instead, continue throwing error because this is indeed an error and not something that can be corrected by data reconciliation.
2025-12-05 10:32:57 -06:00
859 changed files with 53848 additions and 17112 deletions
description: Simplify and refine code for clarity, consistency, and maintainability while preserving all functionality. Focuses on recently modified code unless instructed otherwise.
---
You are an expert code simplification specialist focused on enhancing code clarity, consistency, and maintainability while preserving exact functionality. Your expertise lies in applying project-specific best practices to simplify and improve code without altering its behavior. You prioritize readable, explicit code over overly compact solutions. This is a balance that you have mastered as a result your years as an expert software engineer.
You will analyze recently modified code and apply refinements that:
1.**Preserve Functionality**: Never change what the code does - only how it does it. All original features, outputs, and behaviors must remain intact.
2.**Apply Project Standards**: Follow the established coding standards from the project's configuration files (e.g., `.clinerules/`, `.editorconfig`, linter configs, README, CONTRIBUTING) including patterns like:
- Consistent import/include ordering and organization
- Idiomatic function and method declaration style for the language
- Explicit type annotations where the language supports them
5.**Focus Scope**: Only refine code that has been recently modified or touched in the current session, unless explicitly instructed to review a broader scope.
Your refinement process:
1. Identify the recently modified code sections
2. Analyze for opportunities to improve elegance and consistency
3. Apply project-specific best practices and coding standards
4. Ensure all functionality remains unchanged
5. Verify the refined code is simpler and more maintainable
6. Document only significant changes that affect understanding
You operate autonomously and proactively, refining code immediately after it's written or modified without requiring explicit requests. Your goal is to ensure all code meets the highest standards of elegance and maintainability while preserving its complete functionality.
description: Create a GitHub pull request following project conventions. Use when the user asks to create a PR, submit changes for review, or open a pull request. Handles commit analysis, branch management, and PR creation using the gh CLI tool.
---
# Create Pull Request
This skill guides you through creating a well-structured GitHub pull request that follows project conventions and best practices.
## Prerequisites Check
Before proceeding, verify the following:
### 1. Check if `gh` CLI is installed
```bash
gh --version
```
If not installed, inform the user:
> The GitHub CLI (`gh`) is required but not installed. Please install it:
> - macOS: `brew install gh`
> - Other: https://cli.github.com/
### 2. Check if authenticated with GitHub
```bash
gh auth status
```
If not authenticated, guide the user to run `gh auth login`.
### 3. Verify clean working directory
```bash
git status
```
If there are uncommitted changes, ask the user whether to:
- Commit them as part of this PR
- Stash them temporarily
- Discard them (with caution)
## Gather Context
### 1. Identify the current branch
```bash
git branch --show-current
```
Ensure you're not on `main` or `master`. If so, ask the user to create or switch to a feature branch.
### 2. Find the base branch
```bash
git remote show origin | grep "HEAD branch"
```
This is typically `main` or `master`.
### 3. Analyze recent commits relevant to this PR
```bash
git log origin/main..HEAD --oneline --no-decorate
```
Review these commits to understand:
- What changes are being introduced
- The scope of the PR (single feature/fix or multiple changes)
- Whether commits should be squashed or reorganized
### 4. Review the diff
```bash
git diff origin/main..HEAD --stat
```
This shows which files changed and helps identify the type of change.
## Information Gathering
Before creating the PR, you need the following information. Check if it can be inferred from:
- Commit messages
- Branch name (e.g., `fix/issue-123`, `feature/new-login`)
- Changed files and their content
If any critical information is missing, use `ask_followup_question` to ask the user:
### Required Information
1.**Related Issue Number**: Look for patterns like `#123`, `fixes #123`, or `closes #123` in commit messages
2.**Description**: What problem does this solve? Why were these changes made?
3.**Type of Change**: Bug fix, new feature, breaking change, refactor, cosmetic, documentation, or workflow
4.**Test Procedure**: How was this tested? What could break?
### Example clarifying question
If the issue number is not found:
> I couldn't find a related issue number in the commit messages or branch name. What GitHub issue does this PR address? (Enter the issue number, e.g., "123" or "N/A" for small fixes)
## Git Best Practices
Before creating the PR, consider these best practices:
### Commit Hygiene
1.**Atomic commits**: Each commit should represent a single logical change
2.**Clear commit messages**: Follow conventional commit format when possible
3.**No merge commits**: Prefer rebasing over merging to keep history clean
### Branch Management
1.**Rebase on latest main** (if needed):
```bash
git fetch origin
git rebase origin/main
```
2. **Squash if appropriate**: If there are many small "WIP" commits, consider interactive rebase:
```bash
git rebase -i origin/main
```
Only suggest this if commits appear messy and the user is comfortable with rebasing.
### Push Changes
Ensure all commits are pushed:
```bash
git push origin HEAD
```
If the branch was rebased, you may need:
```bash
git push origin HEAD --force-with-lease
```
## Create the Pull Request
**IMPORTANT**: Read and use the PR template at `.github/pull_request_template.md`. The PR body format must **strictly match** the template structure. Do not deviate from the template format.
When filling out the template:
- Replace `#XXXX` with the actual issue number, or keep as `#XXXX` if no issue exists (for small fixes)
- Fill in all sections with relevant information gathered from commits and context
- Mark the appropriate "Type of Change" checkbox(es)
- Complete the "Pre-flight Checklist" items that apply
### Create PR with gh CLI
```bash
gh pr create --title "PR_TITLE" --body "PR_BODY" --base main
```
Alternatively, create as draft if the user wants review before marking ready:
```bash
gh pr create --title "PR_TITLE" --body "PR_BODY" --base main --draft
```
## Post-Creation
After creating the PR:
1. **Display the PR URL** so the user can review it
2. **Remind about CI checks**: Tests and linting will run automatically
3. **Suggest next steps**:
- Add reviewers if needed: `gh pr edit --add-reviewer USERNAME`
- Add labels if needed: `gh pr edit --add-label "bug"`
## Error Handling
### Common Issues
1. **No commits ahead of main**: The branch has no changes to submit
- Ask if the user meant to work on a different branch
2. **Branch not pushed**: Remote doesn't have the branch
- Push the branch first: `git push -u origin HEAD`
3. **PR already exists**: A PR for this branch already exists
- Show the existing PR: `gh pr view`
- Ask if they want to update it instead
4. **Merge conflicts**: Branch conflicts with base
- Guide user through resolving conflicts or rebasing
## Summary Checklist
Before finalizing, ensure:
- [ ] `gh` CLI is installed and authenticated
- [ ] Working directory is clean
- [ ] All commits are pushed
- [ ] Branch is up-to-date with base branch
- [ ] Related issue number is identified, or placeholder is used
This file is the secret sauce for working effectively in this codebase. It captures tribal knowledge—the nuanced, non-obvious patterns that make the difference between a quick fix and hours of back-and-forth & human intervention.
**When to add to this file:**
- User had to intervene, correct, or hand-hold
- Multiple back-and-forth attempts were needed to get something working
- You discovered something that required reading many files to understand
- A change touched files you wouldn't have guessed
- Something worked differently than you expected
- User explicitly asks to "add this to CLAUDE.md"
**Proactively suggest additions** when any of the above happen—don't wait to be asked.
**What NOT to add:** Stuff you can figure out from reading a few files, obvious patterns, or standard practices. This file should be high-signal, not comprehensive.
## Miscellaneous
- This is a VS Code extension—check `package.json` for available scripts before trying to verify builds (e.g., `npm run compile`, not `npm run build`).
- When creating PRs, if the change is user-facing and significant enough to warrant a changelog entry, run `npm run changeset` and create a patch changeset. Never create minor or major version bumps. Skip changesets for trivial fixes, internal refactors, or minor UI tweaks that users wouldn't notice.
- When adding new feature flags, see this PR as a reference https://github.com/cline/cline/pull/7566
- Additional instructions about making requests: @.clinerules/network.md
## gRPC/Protobuf Communication
The extension and webview communicate via gRPC-like protocol over VS Code message passing.
**Proto files live in `proto/`** (e.g., `proto/cline/task.proto`, `proto/cline/ui.proto`)
- Each feature domain has its own `.proto` file
- For simple data, use shared types in `proto/cline/common.proto` (`StringRequest`, `Empty`, `Int64Request`)
- For complex data, define custom messages in the feature's `.proto` file
When adding a new provider (e.g., "openai-codex"), you must update the proto conversion layer in THREE places or the provider will silently reset to Anthropic:
1.`proto/cline/models.proto` - Add to the `ApiProvider` enum (e.g., `OPENAI_CODEX = 40;`)
2.`convertApiProviderToProto()` in `src/shared/proto-conversions/models/api-configuration-conversion.ts` - Add case mapping string to proto enum
3.`convertProtoToApiProvider()` in the same file - Add case mapping proto enum back to string
**Why this matters:** Without these, the provider string hits the `default` case and returns `ANTHROPIC`. The webview, provider list, and handler all work fine, but the state silently resets when it round-trips through proto serialization. No error is thrown.
**Other files to update when adding a provider:**
-`src/shared/api.ts` - Add to `ApiProvider` union type, define models
-`src/shared/providers/providers.json` - Add to provider list for dropdown
-`src/core/api/index.ts` - Register handler in `createHandlerForProvider()`
-`webview-ui/src/components/settings/utils/providerUtils.ts` - Add cases in `getModelsForProvider()` and `normalizeApiConfiguration()`
-`webview-ui/src/utils/validate.ts` - Add validation case
## Responses API Providers (OpenAI Codex, OpenAI Native)
Providers using OpenAI's Responses API require native tool calling. XML tools don't work with the Responses API.
**Symptoms of broken native tool calling:**
- Tools get called multiple times (e.g., `ask_followup_question` asks the same question twice)
- Tool arguments get duplicated or malformed
- The model responds but tools aren't recognized
**Root causes to check:**
1.**Provider missing from `isNextGenModelProvider()`** in `src/utils/model-utils.ts`. The native variant matchers (e.g., `native-gpt-5/config.ts`) call this function. If your provider isn't in the list, the matcher returns false and falls back to XML tools.
2.**Model missing `apiFormat: ApiFormat.OPENAI_RESPONSES`** in its model info (`src/shared/api.ts`). This property signals that the model requires native tool calling. The task runner in `src/core/task/index.ts` checks this and forces `enableNativeToolCalls: true` regardless of user settings.
**When adding a new Responses API provider:**
1. Add provider to `isNextGenModelProvider()` list in `src/utils/model-utils.ts`
2. Set `apiFormat: ApiFormat.OPENAI_RESPONSES` on all models that use the Responses API
3. The variant matcher and task runner will handle the rest automatically
## Adding Tools to System Prompt
This is tricky—multiple prompt variants and configs. **Always search for existing similar tools first and follow their pattern.** Look at the full chain from prompt definition → variant configs → handler → UI before implementing.
1.**Add to `ClineDefaultTool` enum** in `src/shared/tools.ts`
2.**Tool definition** in `src/core/prompts/system-prompt/tools/` (create file like `generate_explanation.ts`)
- Define variants for each `ModelFamily` (generic, next-gen, xs, etc.)
- **Fallback behavior**: If a variant isn't defined for a model family, `ClineToolSet.getToolByNameWithFallback()` automatically falls back to GENERIC. So you only need to export `[GENERIC]` unless the tool needs model-specific behavior.
3.**Register in `src/core/prompts/system-prompt/tools/init.ts`** - Import and spread into `allToolVariants`
4.**Add to variant configs** - Each model family has its own config in `src/core/prompts/system-prompt/variants/*/config.ts`. Add your tool's enum to the `.tools()` list:
**How overrides work:** Variants can override components via `componentOverrides` in their `config.ts`, or provide a custom template in `template.ts` (e.g., `next-gen/template.ts` exports `rules_template`). If no override, the shared component from `components/` is used.
**Example: Adding a rule to RULES section**
1. Check if variant overrides rules: look for `rules_template` in `variants/*/template.ts` or `componentOverrides.RULES` in `config.ts`
2. If shared: modify `components/rules.ts`
3. If overridden: modify that variant's template
4. XS variant is special—has heavily condensed inline content in `template.ts`
**After any changes, regenerate snapshots:**
```bash
UPDATE_SNAPSHOTS=true npm run test:unit
```
Snapshots live in `__tests__/__snapshots__/`. Tests validate across model families and context variations (browser, MCP, focus chain).
Adding a new key to global state requires updates in multiple places. Missing any step causes silent failures.
Required steps:
1. Type definition in `src/shared/storage/state-keys.ts` - Add to `GlobalState` or `Settings` interface
2. Read from globalState in `src/core/storage/utils/state-helpers.ts`:
- Add `const myKey = context.globalState.get<GlobalStateAndSettings["myKey"]>("myKey")` in `readGlobalStateFromDisk()`
- Add to the return object: `myKey: myKey ?? defaultValue,`
3. StateManager handles read/write via `setGlobalState()`/`getGlobalStateKey()` after initialization
Common mistake: Adding only the return value without the `context.globalState.get()` call. This compiles but the value is always `undefined` on load.
## StateManager Cache vs Direct globalState Access
StateManager uses an in-memory cache populated during `StateManager.initialize(context)` in `common.ts`. For most state, use `controller.stateManager.setGlobalState()`/`getGlobalStateKey()`.
Exception: State needed immediately at extension startup (before cache is ready)
When Window A sets state and immediately opens Window B, the new window's StateManager cache is populated from `context.globalState` during initialization. If you need to read state in Window B right at startup (e.g., in `common.ts` during `initialize()`), read directly from `context.globalState.get()` instead of StateManager's cache.
Example pattern (see `lastShownAnnouncementId` and `worktreeAutoOpenPath`):
This is only needed for cross-window state read during the brief startup window before StateManager cache is fully usable. Normal state access after initialization should use StateManager.
## ChatRow Cancelled/Interrupted States
When a ChatRow displays a loading/in-progress state (spinner), you must handle what happens when the task is cancelled. This is non-obvious because cancellation doesn't update the message content—you have to infer it from context.
**The pattern:**
1. A message has a `status` field (e.g., `"generating"`, `"complete"`, `"error"`) stored in `message.text` as JSON
2. When cancelled mid-operation, the status stays `"generating"` forever—no one updates it
3. To detect cancellation, check TWO conditions:
-`!isLast` — if this message is no longer the last message, something else happened after it (interrupted)
-`lastModifiedMessage?.ask === "resume_task" || "resume_completed_task"` — task was just cancelled and is waiting to resume
-`!isLast` catches: cancelled → resumed → did other stuff → this old message is stale
-`lastModifiedMessage?.ask === "resume_task"` catches: just cancelled, hasn't resumed yet, this message is still technically "last"
**See also:**`BrowserSessionRow.tsx` uses similar pattern with `isLastApiReqInterrupted` and `isLastMessageResume`.
**Backend side:** When streaming is cancelled, clean up properly (close tabs, clear comments, etc.) by checking `taskState.abort` after the streaming function returns.
Also get the commit messages already on the tag (to identify previously cherry-picked commits). Note: Run these as separate commands to avoid shell parsing issues with parentheses in author names:
```bash
LAST_TAG=$(git tag --sort=-v:refname | head -1)
PREV_TAG=$(git tag --sort=-v:refname | head -2 | tail -1)
**Present the list** to the user in a numbered format with commit hash, subject, and author. For any commits whose subject line already appears in the tag's history (previously cherry-picked in an earlier hotfix) or are "Release Notes" commits, add `(already in previous hotfix)` or `(release notes - skip)` after them so the user knows to skip those.
Ask which commits to include in the hotfix.
Use the ask_followup_question tool to let the user specify which commits they want (by number or hash).
## Step 3: Analyze Selected Commits
For each selected commit:
1. Get the full commit message: `git show --no-patch --format="%B" <hash>`
2. Get the diff to understand the change: `git show <hash> --stat`
3. Find the associated PR if any: `gh pr list --search "<hash>" --state merged --json number,title --jq '.[0]'`
Build a mental model of what these changes do for the changelog.
## Step 4: Determine New Version Number
Parse the current version from package.json and the last tag:
```bash
LAST_TAG=$(git tag --sort=-v:refname | head -1)
echo"Last release: $LAST_TAG"
cat package.json | grep '"version"'
```
Hotfixes always increment the patch version (e.g., 3.40.0 -> 3.40.1, or 3.40.1 -> 3.40.2).
**Ask the user to confirm the new version number.**
## Step 5: Create Release Notes Commit on Main
On the main branch, create a commit that updates:
1.**CHANGELOG.md** - Add a new section for the hotfix version at the top:
```markdown
## [3.40.1]
- Description of fix 1
- Description of fix 2
```
Write clear, user-friendly descriptions based on your analysis of the commits.
2. **package.json** - Update the version field to the new version
3. **Delete changesets** for the commits being included in the hotfix. This prevents the changeset bot from including duplicate entries in the next regular release.
Find and delete the changeset files associated with the selected commits:
```bash
ls .changeset/
```
Each changeset file in `.changeset/` corresponds to a PR. Read them to identify which ones belong to the commits you're hotfixing, then delete those files.
**Skip running `npm run install:all`** - the automation handles outdated lockfiles.
Commit with message format: `v{VERSION} Release Notes (hotfix)`
In the commit body, mention:
- This is for a hotfix release
- List the cherry-picked commits that will be included
```bash
git add CHANGELOG.md package.json .changeset/
git commit -m "v3.40.1 Release Notes (hotfix)
Hotfix release including:
- <commit1-hash>: <description>
- <commit2-hash>: <description>
"
```
Push to main:
```bash
git push origin main
```
## Step 6: Build the Hotfix on the Tag
Checkout the last release tag (detached HEAD):
```bash
LAST_TAG=$(git tag --sort=-v:refname | head -1)
git checkout $LAST_TAG
```
Cherry-pick the selected commits in order:
```bash
git cherry-pick <commit1-hash>
git cherry-pick <commit2-hash>
# ... etc
```
Finally, cherry-pick the release notes commit you just pushed to main:
```bash
# Get the hash of the release notes commit (should be HEAD of main)
RELEASE_NOTES_COMMIT=$(git rev-parse main)
git cherry-pick $RELEASE_NOTES_COMMIT
```
## Step 7: Tag and Push
After all cherry-picks are applied successfully:
```bash
# Tag the new release
git tag v{VERSION}
# Push the tag to remote
git push origin v{VERSION}
```
## Step 8: Return to Main and Summary
Return to main branch:
```bash
git checkout main
```
**Copy a Slack announcement message to clipboard** with the version and PR links for each included fix:
```
VS Code Hotfix v{VERSION} Published
- Description of fix 1 https://github.com/cline/cline/pull/{PR_NUMBER}
- Description of fix 2 https://github.com/cline/cline/pull/{PR_NUMBER}
```
Present a final summary:
- New version: v{VERSION}
- Tag pushed: yes
- Commits included: (list them)
- Slack message copied to clipboard: yes
Remind the user to:
1. Manually trigger the publish release GitHub Action at: https://github.com/cline/cline/actions/workflows/publish.yml (paste `v{VERSION}` as the tag)
2. Post the Slack message to announce the hotfix
## Important Notes
- This workflow does NOT create a release branch - only tags
- The release notes commit goes to main first, then gets cherry-picked to the tag
- This keeps main's history accurate while allowing hotfix releases from tags
- If cherry-pick conflicts occur, resolve them before continuing
Search thoroughly for existing issues that match this one:
gh issue list --search "<keywords from the issue>" --state all --limit 30
gh issue list --search "<error messages>" --state all --limit 20
gh issue list --search "<affected feature/component>" --state all --limit 20
For each relevant issue you find, read it including its comments:
gh issue view <number> --comments
You're looking for:
- **Duplicates**: Issues describing the same problem. Link to them and explain why you think they're duplicates. If closed, check how they were resolved - the solution might apply here.
- **Related issues**: Similar problems or context that could help. Pull useful information from their comments (workarounds others found, debugging steps that helped, maintainer explanations). Link to them and explain the connection.
If there are closed issues with solutions, surface those solutions prominently - this might immediately solve the user's problem.
### Analyze recent changes (ALWAYS DO THIS)
Many issues are regressions from recent releases. **Always** check what changed recently:
gh release list --limit 10
gh pr list --state merged --limit 50 --json number,title,mergedAt,author,body
Look for PRs merged in the last few weeks that might correlate with the issue. If you find a likely connection:
- If you find a regression, call it out explicitly: which PR/commit likely caused it, who authored it, what changed, and suggest a fix direction if you can see one.
- If you don't find anything related, still mention it: "I analyzed recent PRs and releases but didn't find any changes that seem related to this issue."
### Search the codebase
Find the relevant code:
- Use grep/find to locate code related to the issue
- Key areas: `src/api/` (providers/models), `src/core/prompts/` (tools/prompts), platform-specific code for VS Code vs JetBrains
### Find documentation
Cline docs are at **https://docs.cline.bot/** and built with Mintlify from the `docs/` directory.
The URL structure maps directly to the file structure:
Cross-reference with GitHub usernames. Include in your response (@mention, do NOT assign):
| SME | Reason |
|-----|--------|
| @username1 | Authored PR #X which modified this area |
| @username2 | Primary contributor to affected file |
## Weak model detection
Many issues are caused by users running small or non-frontier models that don't tool-call reliably. Signs include:
- Model failing to use tools correctly
- Nonsensical or malformed responses
- User is running a small/local model or older model version
If this looks like a weak model issue, kindly suggest they try reproducing with Claude Sonnet and report back if it persists. Link to https://docs.cline.bot/getting-started/selecting-your-model if helpful. Still label and triage normally.
## Your comment
Write a single comment as a helpful community member. Be conversational, not robotic. Include what's relevant:
- **Helpful response** - Answer their question, suggest a fix, provide a workaround. If you found solutions in related closed issues, surface those prominently.
- **Duplicates and related issues** - Link to any you found and explain why they're duplicates/related. Summarize useful context from their comments.
- **Regression analysis** - If this looks like a regression, explain what change likely caused it, link to the PR/commit, and tag the author.
- **Clarifying questions** - If you need more info, ask specific questions. Don't ask for things already provided.
- **SME table** - Include the table above if this needs engineering attention. Don't tag people for questions with obvious answers or weak-model issues.
- **Context for maintainers** - Relevant code paths, what you found. Keep it concise.
- **Docs links** - If there's relevant documentation, link to it naturally in your response as a recommendation (e.g., "For more details, check out [the Ollama setup guide](url)"). Do NOT add a "Sources" section at the end - integrate doc links into your response where they're helpful.
- **Possible Duplicates section** - ALWAYS include a "Possible Duplicates" section at the end of your comment listing issues that might be duplicates so maintainers can quickly close if appropriate. If none found, say "No obvious duplicates found."
## Labels
First, retrieve all available labels and read their descriptions to understand what each is for:
gh label list --json name,description --limit 100
Then apply the appropriate labels based on your analysis. Only use labels from the list above—do not create new labels.
- **This is a one-time automated response** - you will NOT see their reply or respond again. Never say things like "I can help you", "let me know", "once I have that info", or "I can give you more targeted help" - you won't be there to follow up. If you ask clarifying questions, frame them for the maintainers who will follow up, e.g., "If you can share X, that would help the maintainers diagnose this."
- Don't be formulaic. Respond to what the issue actually needs.
- Surface solutions from past issues - often the fastest path to helping.
- Connecting regressions to specific changes is extremely valuable.
You're a GitHub PR reviewer for the open source Cline repository. Your goal is to give the PR author helpful feedback and give maintainers the context they need to review efficiently.
Cross-reference git authors with GitHub usernames. Include an SME table in your response:
| SME | Reason |
|-----|--------|
| @username1 | Authored PR #X which modified this area |
| @username2 | Primary contributor to affected file (15 commits in 6 months) |
| @username3 | Reviewed similar PR #Y with extensive feedback |
## Deep code review
This is the most important part. Don't just look for syntax issues - understand what the PR is trying to achieve and whether the implementation is the right approach.
Step 1: Understand the intent
Read the PR description and understand what the author is trying to accomplish. What problem are they solving? What feature are they adding?
Step 2: Form your own opinion first
Before analyzing their code, think about how YOU would implement this feature or fix. What files would you touch? What patterns would you follow? What edge cases would you handle?
Step 3: Compare approaches
Now look at their implementation. How does it compare to what you would have done?
- Is their approach better in some ways? Note what they did well.
- Is their approach missing something? Be specific about what and why.
- Are there edge cases they haven't considered?
- Does it follow the patterns established in similar parts of the codebase?
Step 4: Look at the bigger picture
- What other files or systems does this change interact with?
- Could this break anything else?
- Is there additional work needed beyond this PR to complete the feature?
- Does this fit well with the overall architecture?
Step 5: Find reference implementations
Look for similar changes in the codebase:
```bash
git log --oneline --all --grep="<relevant keywords>" | head -20
git log --oneline -- <similar files> | head -20
```
If this is adding a new API provider, look at how other providers are implemented.
If this is adding a new feature, look at how similar features were added.
Note where their implementation aligns with or diverges from established patterns.
Step 6: Standard code review checks
- DRY: Is there duplicated code that could be extracted?
- Error handling: Are errors handled appropriately?
- Security: Any injection risks, credential exposure, unsafe dependencies?
- Performance: Any obvious inefficiencies, memory leaks, N+1 patterns?
- Types: Is TypeScript used correctly? Any unsafe type assertions?
- Naming: Are variables and functions named clearly?
- Comments: Is complex logic explained? Are there outdated comments?
## Inline code suggestions
For specific code improvements, use GitHub's suggestion syntax via `gh api`.
This creates suggestions the author can commit with one click.
Single-line suggestion:
```bash
gh api repos/${{ github.repository }}/pulls/${{ steps.pr.outputs.number }}/reviews \
"body": "This can be simplified:\n\n```suggestion\nconst simplified = doThing();\n```"
}
]'
```
Use inline suggestions for concrete improvements. Use regular comments for questions or broader feedback.
## Post your review
After your investigation, post a single helpful comment that helps the author and gives maintainers context.
Start with a warm thank you for their contribution. Be conversational, not robotic.
Include what's relevant:
- In-depth explanation of what the PR does - Be comprehensive. A maintainer should be able to read this section and fully understand the author's intent, why they made the changes, how they implemented it, and what files/systems are affected. Don't just summarize - explain.
- Related issues/PRs you found that provide useful context (link to them)
- Your review findings (issues to address, suggestions, etc.)
- Clear next steps for the author
Include a "For Maintainers" section with:
- Anything else useful to help the maintainer resolve this PR
- Related issues/PRs with context on why they're relevant
- Open issues this PR might fix that weren't linked in the description
- Your recommendation: merge as-is, needs changes, needs discussion, close, etc.
- SME table - who should review this and why
For the SME table:
| SME | Reason |
|-----|--------|
| @username | Primary contributor to affected files |
- This is a one-time automated response - you will NOT see their reply or respond again. Never say things like "let me know if you have questions", "I can help you with", or "feel free to ask" - you won't be there to follow up. Frame any questions for the maintainers who will follow up.
- Be helpful and welcoming - Many contributors are new to the project
- Be specific - Point to exact lines and suggest fixes, don't give vague feedback
- Think deeply - Don't just surface-level review, understand the intent and evaluate the approach
- Use inline suggestions - Make it easy for authors to accept changes
- You're a first-pass reviewer - A human maintainer will do final approval
"gh api repos/${{ github.repository }}/pulls/${{ steps.pr.outputs.number }}/comments *",
"gh api repos/${{ github.repository }}/pulls/${{ steps.pr.outputs.number }}/reviews *"
]
}
run:|
npx cline --yolo 'You'\''re a GitHub PR reviewer for the open source Cline repository. Your goal is to give the PR author helpful feedback and give maintainers the context they need to review efficiently.
Cross-reference git authors with GitHub usernames. Include an SME table in your response:
| SME | Reason |
|-----|--------|
| @username1 | Authored PR #X which modified this area |
| @username2 | Primary contributor to affected file (15 commits in 6 months) |
| @username3 | Reviewed similar PR #Y with extensive feedback |
## Bash command usage
Don'\''t use operators like `|`, `&&`, or `;` - run each command separately and analyze the output.
When referencing command outputs, quote them properly to avoid formatting issues.
## Deep code review
This is the most important part. Don'\''t just look for syntax issues - understand what the PR is trying to achieve and whether the implementation is the right approach.
Step 1: Understand the intent
Read the PR description and understand what the author is trying to accomplish. What problem are they solving? What feature are they adding?
Step 2: Form your own opinion first
Before analyzing their code, think about how YOU would implement this feature or fix. What files would you touch? What patterns would you follow? What edge cases would you handle?
Step 3: Compare approaches
Now look at their implementation. How does it compare to what you would have done?
- Is their approach better in some ways? Note what they did well.
- Is their approach missing something? Be specific about what and why.
- Are there edge cases they haven'\''t considered?
- Does it follow the patterns established in similar parts of the codebase?
Step 4: Look at the bigger picture
- What other files or systems does this change interact with?
- Could this break anything else?
- Is there additional work needed beyond this PR to complete the feature?
- Does this fit well with the overall architecture?
Step 5: Find reference implementations
Look for similar changes in the codebase:
```bash
git log --oneline --all --grep='\''<relevant keywords>'\'' | head -20
git log --oneline -- <similar files> | head -20
```
If this is adding a new API provider, look at how other providers are implemented.
If this is adding a new feature, look at how similar features were added.
Note where their implementation aligns with or diverges from established patterns.
Step 6: Standard code review checks
- DRY: Is there duplicated code that could be extracted?
- Error handling: Are errors handled appropriately?
- Security: Any injection risks, credential exposure, unsafe dependencies?
- Performance: Any obvious inefficiencies, memory leaks, N+1 patterns?
- Types: Is TypeScript used correctly? Any unsafe type assertions?
- Naming: Are variables and functions named clearly?
- Comments: Is complex logic explained? Are there outdated comments?
## Inline code suggestions
For specific code improvements, use GitHub'\''s suggestion syntax via `gh api`.
This creates suggestions the author can commit with one click.
Single-line suggestion:
```bash
gh api repos/'"${GITHUB_REPO}"'/pulls/'"${PR_NUMBER}"'/reviews \
"body": "This can be simplified:\n\n```suggestion\nconst simplified = doThing();\n```"
}
]'\''
```
Use inline suggestions for concrete improvements. Use regular comments for questions or broader feedback.
## Post your review
After your investigation, post a single helpful comment that helps the author and gives maintainers context.
Start with a warm thank you for their contribution. Be conversational, not robotic.
Include what'\''s relevant:
- In-depth explanation of what the PR does - Be comprehensive. A maintainer should be able to read this section and fully understand the author'\''s intent, why they made the changes, how they implemented it, and what files/systems are affected. Don'\''t just summarize - explain.
- Related issues/PRs you found that provide useful context (link to them)
- Your review findings (issues to address, suggestions, etc.)
- Clear next steps for the author
Include a '\''For Maintainers'\'' section with:
- Anything else useful to help the maintainer resolve this PR
- Related issues/PRs with context on why they'\''re relevant
- Open issues this PR might fix that weren'\''t linked in the description
- Your recommendation: merge as-is, needs changes, needs discussion, close, etc.
- SME table - who should review this and why
For the SME table:
| SME | Reason |
|-----|--------|
| @username | Primary contributor to affected files |
- This is a one-time automated response - you will NOT see their reply or respond again. Never say things like '\''let me know if you have questions'\'', '\''I can help you with'\'', or '\''feel free to ask'\'' - you won'\''t be there to follow up. Frame any questions for the maintainers who will follow up.
- Be helpful and welcoming - Many contributors are new to the project
- Be specific - Point to exact lines and suggest fixes, don'\''t give vague feedback
- Think deeply - Don'\''t just surface-level review, understand the intent and evaluate the approach
- Use inline suggestions - Make it easy for authors to accept changes
- You'\''re a first-pass reviewer - A human maintainer will do final approval'
# Ignore all webview-ui files except the build directory (https://github.com/microsoft/vscode-webview-ui-toolkit-samples/blob/main/frameworks/hello-world-react-cra/.vscodeignore)
- Users with ChatGPT Plus or Pro subscriptions can now use GPT-5 models directly through Cline without needing an API key. Authentication is handled via OAuth through OpenAI's authentication system.
- Grok models are now moving out of free tier and into paid plans.
- Introduces comprehensive Jupyter Notebook support for Cline, enabling AI-assisted editing of `.ipynb` files with full cell-level context awareness.
### Fixed
- Bugs in DiffViewProvider for file editing
- Ollama's recommended models to use correct identifiers
## [3.51.0]
### Added
- Adding OpenAI gpt-5.2-codex model to the model picker
## [3.50.0]
### Added
- Add gpt-5.2-codex OpenAI model support
- Add create-pull-request skill
### Fixed
- Fix the selection of remotely configured providers
- Fix act_mode_respond to prevent consecutive calls
- Fix invalid tool call IDs when switching between model formats
## [3.49.1]
### Added
- Add telemetry to track usage of skills feature
- Add version headers to Cline backend requests
- Phase in Responses API usage instead of defaulting for every supported model
### Fixed
- Fix workflow slash command search to be case-insensitive
- Fix model display in ModelPickerModal when using LiteLLM
- Fix LiteLLM model fetching with default base URL
- Fix crash when OpenAI-compatible APIs send usage chunks with empty or null choices arrays at end of streaming
- Fix model ID for Kat Coder Pro Free model
## [3.49.0]
- Enable configuring an OTEL collector at runtime
- Removing Minimax-2.1 from free model list as the free trial has ended
- Improved image display in MCP responses
- Auto-sync remote MCP servers from remote config to local settings
## [3.48.0]
### Added
- Add Skills system for reusable, on-demand agent instructions
- Add new websearch tooling in Cline provider
- Add zai-glm-4.7 to Cerebras model list
- Add model refresh and improve reasoning support for Vercel AI Gateway
### Fixed
- Revert #8341 due to regressions in diff view/document truncation (see #8423, #8429)
- Fixed extension crash when using context menu selector
## [3.47.0]
### Added
- Added experimental support for Background Edits (allows editing files in background without opening the diff view)
- Updated free model to MiniMax M2.1 (replacing MiniMax M2)
- Added support for Azure based identity authentication in OpenAI Compatible provider and Azure OpenAI
- Add `supportsReasoning` property to Baseten models
### Fixed
- Prevent expired token usage in authenticated requests
- Exclude binary files without extensions from diffs
- Preserve file endings and trailing newlines
- Fix Cerebras rate limiting
- Fix Auto Compact for Claude Code provider
- Make Workspace and Favorites history filters independent
- Fix remote MCP server connection failures (404 response handling)
- Disable native tool calling for Deepseek 3.2 speciale
- Show notification instead of opening sidebar on update
- Fix Baseten model selector
### Refactored
- Modify prompts for parallel tool usage in Claude and Gemini 3 models
## [3.46.1]
### Fixed
- Remove GLM 4.6 from free models
## [3.46.0]
### Added
- Added GLM 4.7 model
- Enhanced background terminal execution with command tracking, log file output, zombie process prevention (10-minute timeout), and clickable log paths in UI
- Apply Patch tool for GPT-5+ models (replacing current diff edit tools)
### Fixed
- Duplicate error messages during streaming for Diff Edit tool when Parallel Tool Calling is not enabled
- Banner carousel styling and dismiss functionality
- Typos in Gemini system prompt overrides
- Model picker favorites ordering, star toggle, and keyboard navigation for OpenRouter and Vercel AI Gateway providers
- Fetch remote config values from the cache
### Refactored
- Anthropic handler to use metadata for reasoning support
- Bedrock provider to use metadata for reasoning support
## [3.45.1]
- Fixed MCP settings race condition where toggling auto-approve or changing timeout settings would cause the UI to flash and revert
## [3.45.0]
- Added Gemini 3 Flash Preview model
## [3.44.2]
- Polished the model picker UI with checkmarks for selected models, tooltips on Plan/Act tabs, and consistent arrow pointers across all popup modals
- Improved WhatsNew modal responsiveness and cleaned up redundant UI elements
- Fixed GLM models outputting garbled text in thinking tags—reasoning is now properly disabled for these models
## [3.44.1]
- Fixed a critical bug where local MCP servers stopped connecting after v3.42.0—all user-configured stdio-based MCP servers should now work again
- Fixed remotely configured API keys not being extracted correctly for enterprise users
- Added support for dynamic tool instructions that adapt based on runtime context, laying groundwork for future context-aware features
## [3.44.0]
## Added
- Updating minor version to show a proper banner for the release
## [3.43.1]
### Patch Changes
- Fix GLM-4.6 Model reference id
## [3.43.0]
### Added
- GLM-4.6
- kat-coder-pro
- Add parsing of env variable patterns to the mcpconfig.json
### Fixed
- TLS Proxy support issues for VSCode
- Add supportsReasoning flag to OpenAI reasoning models
- Fix thinking not available for some models in the OpenAI provider
- Fix invalid signature field issues when switching between Gemini and Anthropic providers
- Extract OpenRouter model filtering into reusable utility and use it in different model pickers
- Fix a11y for auto approve checkbox
- Improve ModelPickerModal provider list layout
### Refactored
- Migrate WhatsNewModal to new shared dialogue component
## [3.42.0]
### Added
- Expose `getAvailableSlashCommands` rpc endpoint to UI clients
- Made slash command menu and context menu accessible and screenreader-friendly
- Made expanding/collapsing UI components accessible
### Fixed
- Devstral OpenRouter model ID and routing issues
- Incorrect pricing display for Devstral model in the extension
## [3.41.0]
### Added
- OpenAI GPT-5.2
- Devstral-2512 (formerly stealth model "Microwave")
- Improvements to chat modal model picker
- Amazon Nova 2 Lite
- DeepSeek 3.2 to native tool calling allow list
- Responses API support for Codex models in OpenAI provider (requires native tool calling)
- Xmas Special Santa Cline
- Welcome screen UI enhancements
### Fixed
- Initial checkpoint commit now non-blocking for improved responsiveness in large repositories
- Gemini Vertex models erroring when thinking parameters are not supported
- Restrictive file permissions for secrets.json
- Ollama streaming requests not aborting when task is cancelled
### Refactored
- OpenAI provider to centralize temperature configuration and include missing GPT-5 model settings
- OpenAI native handler to use metadata for model capabilities
- Vertex provider to use metadata for model capabilities
## [3.40.2]
- Fix logout on network errors during token refresh (e.g., opening laptop while offline)
## [3.40.1]
- Fix cost calculation display for Anthropic API requests
## [3.40.0]
- Fix highlighted text flashing when task header is collapsed
This file is the secret sauce for working effectively in this codebase. It captures tribal knowledge—the nuanced, non-obvious patterns that make the difference between a quick fix and hours of back-and-forth & human intervention.
**When to add to this file:**
- User had to intervene, correct, or hand-hold
- Multiple back-and-forth attempts were needed to get something working
- You discovered something that required reading many files to understand
- A change touched files you wouldn't have guessed
- Something worked differently than you expected
- User explicitly asks to "add this to CLAUDE.md"
**Proactively suggest additions** when any of the above happen—don't wait to be asked.
**What NOT to add:** Stuff you can figure out from reading a few files, obvious patterns, or standard practices. This file should be high-signal, not comprehensive.
## gRPC/Protobuf Communication
The extension and webview communicate via gRPC-like protocol over VS Code message passing.
**Proto files live in `proto/`** (e.g., `proto/cline/task.proto`, `proto/cline/ui.proto`)
- Each feature domain has its own `.proto` file
- For simple data, use shared types in `proto/cline/common.proto` (`StringRequest`, `Empty`, `Int64Request`)
- For complex data, define custom messages in the feature's `.proto` file
This is tricky—multiple prompt variants and configs. **Always search for existing similar tools first and follow their pattern.** Look at the full chain from prompt definition → variant configs → handler → UI before implementing.
1.**Add to `ClineDefaultTool` enum** in `src/shared/tools.ts`
2.**Tool definition** in `src/core/prompts/system-prompt/tools/` (create file like `generate_explanation.ts`)
- Define variants for each `ModelFamily` (generic, next-gen, xs, etc.)
- **Fallback behavior**: If a variant isn't defined for a model family, `ClineToolSet.getToolByNameWithFallback()` automatically falls back to GENERIC. So you only need to export `[GENERIC]` unless the tool needs model-specific behavior.
3.**Register in `src/core/prompts/system-prompt/tools/init.ts`** - Import and spread into `allToolVariants`
4.**Add to variant configs** - Each model family has its own config in `src/core/prompts/system-prompt/variants/*/config.ts`. Add your tool's enum to the `.tools()` list:
**How overrides work:** Variants can override components via `componentOverrides` in their `config.ts`, or provide a custom template in `template.ts` (e.g., `next-gen/template.ts` exports `rules_template`). If no override, the shared component from `components/` is used.
**Example: Adding a rule to RULES section**
1. Check if variant overrides rules: look for `rules_template` in `variants/*/template.ts` or `componentOverrides.RULES` in `config.ts`
2. If shared: modify `components/rules.ts`
3. If overridden: modify that variant's template
4. XS variant is special—has heavily condensed inline content in `template.ts`
**After any changes, regenerate snapshots:**
```bash
UPDATE_SNAPSHOTS=true npm run test:unit
```
Snapshots live in `__tests__/__snapshots__/`. Tests validate across model families and context variations (browser, MCP, focus chain).
When a ChatRow displays a loading/in-progress state (spinner), you must handle what happens when the task is cancelled. This is non-obvious because cancellation doesn't update the message content—you have to infer it from context.
**The pattern:**
1. A message has a `status` field (e.g., `"generating"`, `"complete"`, `"error"`) stored in `message.text` as JSON
2. When cancelled mid-operation, the status stays `"generating"` forever—no one updates it
3. To detect cancellation, check TWO conditions:
-`!isLast` — if this message is no longer the last message, something else happened after it (interrupted)
-`lastModifiedMessage?.ask === "resume_task" || "resume_completed_task"` — task was just cancelled and is waiting to resume
-`!isLast` catches: cancelled → resumed → did other stuff → this old message is stale
-`lastModifiedMessage?.ask === "resume_task"` catches: just cancelled, hasn't resumed yet, this message is still technically "last"
**See also:**`BrowserSessionRow.tsx` uses similar pattern with `isLastApiReqInterrupted` and `isLastMessageResume`.
**Backend side:** When streaming is cancelled, clean up properly (close tabs, clear comments, etc.) by checking `taskState.abort` after the streaming function returns.
The CLI is a **standalone terminal interface** for the Cline AI coding assistant, written in Go. It provides the same autonomous coding capabilities as the VS Code extension but runs entirely in the terminal.
| `env.go` | Clipboard access, version info, shutdown coordination |
| `window.go` | UI stubs (no-ops or console output) |
**Why this exists:** The same cline-core logic runs in VS Code and CLI. In VS Code, the "host" is the extension with editor APIs. In CLI, hostbridge emulates these capabilities with terminal-appropriate implementations.
---
## Key Design Decisions
1.**Two-process model:**`cline` CLI manages instances; `cline-core` is the actual AI engine (Node.js). This allows reusing the same core as the VS Code extension.
2.**Self-registration via SQLite:**`cline-core` registers itself in a SQLite database on startup. The CLI discovers instances by reading this database, enabling multi-instance support.
3.**Host bridge abstraction:** The `cline-host` process provides platform-specific operations (clipboard, workspace paths) via gRPC, allowing `cline-core` to remain host-agnostic.
4.**Streaming-first UI:** The CLI uses gRPC streaming to display AI responses in real-time with typewriter-style rendering.
5.**Dual stream handling:** Task manager subscribes to both state updates and partial messages, using deduplication to prevent duplicate rendering.
: Additional workspace paths. Can be specified multiple times to include multiple directories. The current working directory is always included as the first workspace. Example: cline -w /path/to/other/project "refactor shared code"
# GLOBAL OPTIONS
These options apply to all subcommands:
@@ -78,6 +82,28 @@ These options apply to all subcommands:
When you use **-F json**, the CLI prints each client message as JSON.
Each message is a **ClineMessage** object.
Required fields:
- **type**: "ask" or "say"
- **text**: message text
- **ts**: Unix epoch timestamp in milliseconds
Optional fields (omitted when empty):
- **reasoning**: reasoning text
- **say**: say subtype (present when type is "say")
- **ask**: ask subtype (present when type is "ask")
- **partial**: streaming flag
- **images**: list of image URIs
- **files**: list of file paths
- **lastCheckpointHash**: git checkpoint hash
- **isCheckpointCheckedOut**: checkpoint checkout flag
- **isOperationOutsideWorkspace**: workspace safety flag
**-h**, **\--help**
: Display help information for the command.
@@ -297,6 +323,42 @@ cline task view
cline task chat
```
# ENVIRONMENT
**CLINE_COMMAND_PERMISSIONS**
: JSON configuration for restricting which shell commands Cline can execute. When set, commands are validated against allow/deny patterns before execution. When not set, all commands are allowed.
- **allow** (array of strings): Glob patterns for allowed commands. If specified, only matching commands are permitted. Uses `*` to match any characters and `?` to match a single character. Setting allow on anything will deny all others.
- **deny** (array of strings): Glob patterns for denied commands. Deny rules take precedence over allow rules.
- **allowRedirects** (boolean): Whether to allow shell redirects (`>`, `>>`, `<`, etc.). Defaults to false.
**Rule evaluation:**
1. Check for dangerous characters (backticks outside single quotes, unquoted newlines)
2. Parse command into segments split by operators (`&&`, `||`, `|`, `;`)
3. If redirects detected and `allowRedirects` is not true, command is denied
4. Each segment is validated against deny rules first, then allow rules
5. Subshell contents (`$(...)` and `(...)`) are recursively validated
6. All segments must pass for the command to be allowed
returnnil,fmt.Errorf("cline-core.js not found at '%s' or '%s'. Please ensure you're running from the correct location or reinstall with 'npm install -g cline'",clineCorePath,devClineCorePath)
@@ -57,6 +57,20 @@ During installation, you'll authenticate and configure your preferred provider u
- Create GitLab pipelines that generate migration scripts from schema changes
- Build Jenkins jobs that use Cline to analyze test failures and suggest fixes
## Hooks integration
[Hooks](/features/hooks/index) let you inject custom logic into Cline's workflow to validate operations and enforce policies. You can enable hooks when running tasks from the command line:
```bash
# Enable hooks for a task
cline "What does this repo do?" -s hooks_enabled=true
# Configure hooks globally via CLI
cline config set hooks-enabled=true
```
This allows you to integrate hooks into automated workflows, CI/CD pipelines, and headless task execution for consistent enforcement across all environments.
## Learn more
<Columns cols={2}>
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.