* refactor: replace Anthropic MessageParam with ClineStorageMessage type
Replace Anthropic SDK's MessageParam type with the new ClineStorageMessage type across API providers and tests in the effort of storing api messages in a type safe environment that we can expand from and avoid adding undocumented properties to Anthropc Message type that are not visible to the downstream services.
This change:
- Removes dependency on @anthropic-ai/sdk types in multiple providers
- Introduces ClineStorageMessage from shared messages module
- Updates method signatures in Dify, OpenAI, LiteLLM, and ClaudeCode handlers
- Updates corresponding test files to use the new type
This decouples the codebase from Anthropic-specific types and standardizes message handling using an internal storage format across all providers that improves type-safety, preparing for the properties added by the Response API use.
As ClineStorageMessage is an extension of the Anthropic Message type, everything should work the same with no breaking changes. Green CI is expected.
* clean up
* fix(hooks): Reorder the UI elements so that PreToolUse appears above tool
* fix(hooks): Prevent PreToolUse hook from migrating down the screen
* fix(hooks): PreToolUse reordering should apply to 'tool', 'command', 'use_mcp_server', and 'browser_action_launch' message types
* feat: support feature flag payload & dynamic onboarding model list
- Updated proto to use OnboardingModelGroup instead of bool flag for flexible onboarding
- Added getClineOnboardingModels function with caching and remote overrides for dynamic model fetching
- Modified controller to fetch and pass onboarding models to webview
- Updated UI to use dynamic models for selection, enabling flexible onboarding
- Enhanced feature flag service to support non-boolean payloads for better configurability
* clearOnboardingModelsCache
* feat: upgrade sap-ai-sdk major version
* feat: upgrade sap-ai-sdk major version
* feat: upgrade sap-ai-sdk major version
* feat: upgrade sap-ai-sdk major version
* feat: upgrade sap-ai-sdk major version
* feat: upgrade sap-ai-sdk major version
* feat: upgrade sap-ai-sdk major version
* feat: upgrade sap-ai-sdk major version
* feat: upgrade sap-ai-sdk major version
* feat: upgrade sap-ai-sdk major version
* feat: upgrade sap-ai-sdk major version
* fix(hooks): Run PreToolUse only after approval; get it working for read_file first
* fix(hooks): Run PreToolUse only after approval; get it working for six more tools now
* fix(hooks): Run PreToolUse only after approval; get it working for the remaining six tools now
* fix(hooks): Implement HookExecution type to avoid using 'any'
* v3.37.0 Release Notes
- GPT-5.1 with model-specific prompting: tailored system prompts, tool usage, focus chain, and deep-planning optimizations
- Nous Research provider with Hermes 4 model family and custom system prompts
- Model-family breakouts for deep-planning prompting, laying groundwork for enhanced slash commands
- Expanded HTTP proxy support throughout the codebase
- Improved focus chain prompting for frontier models (Anthropic, OpenAI, Gemini, xAI)
- Duplicate tool results prevention through existence checking
- XML entity escaping in model content processor
- Commit message generation in command palette
- OpenAI Compatible provider temperature parameter type conversion
- Added missing proto generation step in CONTRIBUTING.md
- New `npm run dev` script for streamlined terminal workflow (fixes#7335)
* Adding image optimizations
* Adding image optimizations
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Arafatkatze <arafat.da.khan@gmail.com>
Fixes issue where 'cline auth' command would lose all configuration due to process termination race condition.
Root cause: StateManager uses 500ms debounced persistence, but CLI process terminated before setTimeout callback could fire.
Solution: Implemented explicit flushPendingState() mechanism:
- Added StateManager.flushPendingState() method for immediate persistence
- Refactored to extract shared persistence logic (DRY)
- Added flushPendingState gRPC endpoint
- CLI now calls flush instead of using 5s sleep workaround
Results:
- Deterministic persistence (no race condition)
- Faster auth flow (~2s vs 7s)
- Cleaner, more maintainable code
* Remove Qwen3 coder from Cerebras providers
* Update Cerebras Docs to include new model `zai-glm-4.6` and remove `qwen-3-coder-480b-free` and `qwen-3-coder-480b` entries.
---------
Co-authored-by: Juan Pablo <juan@cline.bot>
- Use Anthropic SDK types and return Array<Messages.MessageParam>
- Replace removeReasoningDetails with removeUnknownParams
- Strip unsupported fields (e.g., reasoning_details) and normalize role
- Keep string content unchanged; map array content to known blocks
- Continue adding ephemeral cache_control to targeted user messages
This ensures only Anthropic-supported fields are sent, improving type safety and preventing API errors.
* feat: add AGENTS.md support
* Update webview-ui/src/components/cline-rules/RuleRow.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update webview-ui/src/components/cline-rules/ClineRulesToggleModal.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update font size for documentation link in ClineRulesToggleModal component
* docs: add support for AGENTS.md standard in Cline rules documentation
* fix: delete agents.md
* Add AGENTS.md support
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Follow up from https://github.com/cline/cline/pull/7399
- Only add the redacted reasoning block when a reasoningSignature is present,
instead of checking message length. This aligns with Claude extended thinking
requirements and prevents unsignatured reasoning content from being sent.
- Remove leftover thinkingDeltaAccumulator from the Anthropic provider.
* refactor(api): standardize reasoning yield types across providers
- Unify reasoning output format in Anthropic, Cline, and Minimax handlers
- Change "ant_thinking" and "reasoning_details" to "reasoning" type
- Add signature and redacted_data properties for consistency
- Wrap message_start cases in braces for scoping
- Consolidate yields to reduce redundancy and improve maintainability
* VercelAIGatewayHandler
* feat: add model information tracking to tasks and messages
Add modelId field to TaskResponse and TaskItem proto messages, and introduce ClineModelInfo message type to track provider and model IDs throughout the system. Update API transform functions to use ClineStorageMessage types and refactor message handling to support model information tracking.
This enables better tracking and auditing of which AI models are used for specific tasks and messages, improving observability and allowing for model-specific analytics.
* clean up protos
* remove console log
* minimax
* use new interface
* clean up
CLINE_ENVIRONMENT_OVERRIDE was removed in https://github.com/cline/cline/pull/6621 accidentally. This PR adds it back:
Prioritize CLINE_ENVIRONMENT_OVERRIDE over CLINE_ENVIRONMENT when
setting the runtime environment at module load.
This enables temporary/test-specific environment selection without
modifying the base env var. Existing behavior is unchanged when the
override is not set. Updated inline comment for clarity.
* refactor: Extract provider and model info into method in WriteToFileToolHandler
- Introduce private getModelInfo method to centralize extraction of providerId and modelId
- Replace duplicated telemetry extraction logic across multiple function calls
- Update telemetry service invocations to use the new method's return values for consistency and reduced code duplication/script>
* Update src/core/task/tools/handlers/WriteToFileToolHandler.ts
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
---------
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Add `isNativeToolCall` parameter to telemetry service to track when
assistant turns and provider API errors occur with native tool calls
enabled. This enables better analytics and debugging of native tool
call behavior across conversation turns.
Remove the static _baseUrl field and replace all references with direct calls to ClineEnv.config().apiBaseUrl. This ensures the base URL updates correctly when configuration changes, fixing an issue where the URL remained static even after configuration updates.
* add remotely configured rules and workflows
* fix toggles state not being passes to webview on updates; minor format updates
---------
Co-authored-by: Sarah Fortune <sarah.fortune@gmail.com>
* fix: prevent duplicate tool results by adding existence check
Add a check in ToolResultUtils to skip adding a tool result if one already exists for the same tool_use_id, logging a warning to avoid redundant entries in userMessageContent and maintain message integrity. Introduces Logger import for warning output.
* add changeset
* docs: add guidance for handling strings with quotes in JSON payloads in hooks documentation
- Introduced a new section on using jq's --arg flag for proper escaping of unescaped quote characters in JSON output.
- Provided a code example demonstrating how to handle complex strings or nested JSON structures safely.
This update enhances the documentation by clarifying how to manage JSON payloads effectively within hooks.
* docs: clarify context modification behavior in hooks documentation
- Updated the explanation regarding context modifications and their effect on AI decisions.
- Emphasized the need to return `cancel: true` in PreToolUse hooks to block actions effectively.
This change enhances the clarity of the documentation, ensuring users understand how to implement immediate effects in their hooks.
---------
Co-authored-by: CandiedUniverse <132302818+candieduniverse@users.noreply.github.com>
* Renamed Nous proto config strings
* Revert "feat: migrate terminal execution mode default to background" (#7412)
This reverts commit 0b7393f50e.
---------
Co-authored-by: Ara <arafat.da.khan@gmail.com>
* fix(openai): ensure temperature parameter is explicitly converted to number
Changed temperature assignment to explicitly check for undefined and convert
the value to Number type before use. This prevents potential type issues when
the temperature configuration is provided as a string or other non-number type,
ensuring consistent numeric handling for the OpenAI API.
* set 0 tempature to undefined
* add changeset
* feat: add feature flag to toggle between new and old onboarding view
Add a new feature flag `show_onboarding_flow` that controls whether users see the new onboarding experience or the legacy welcome view. This enables A/B testing and gradual rollout of the new onboarding flow, and gives me better control when model list has changed and the onboarding model list is outdated.
Changes:
- Add ONBOARDING feature flag (enabled by default)
- Add showOnboardingFlow to ExtensionState and proto definitions
- Add getOnboardingEnabled() method to FeatureFlagsService
- Update App component to conditionally render OnboardingView or WelcomeView based on flag
- Extend ExtensionStateContext with showOnboardingFlow state management
This allows for controlled rollout and easy rollback if issues arise with the new onboarding experience.
* default true
* default to false unless e2e test
* showOnboardingFlow default to off
* refactor(task): replace HTML escaping logic with model-specific content fixes
Updated ExecuteCommandToolHandler and WriteToFileToolHandler to utilize a new utility function, applyModelContentFixes, for handling model-specific quirks. This change centralizes the logic for fixing escaped characters and invalid characters, improving maintainability and consistency across command execution and file writing processes. Additionally, introduced ModelContentProcessor to encapsulate the new content processing logic.
* test(ModelContentProcessor): add comprehensive unit tests for applyModelContentFixes
Introduced a new test suite for the ModelContentProcessor, covering various scenarios for the applyModelContentFixes function. Tests include model ID detection, file type handling, orchestration logic, and integration with real-world use cases, ensuring robust validation of content processing for different model types and file formats.
* fix: add changeset for XML escaping bug fix
* refactor(ModelContentProcessor): make modelId parameter optional in applyModelContentFixes
Updated the applyModelContentFixes function to accept an optional modelId parameter, allowing for fixes to be applied even when the model ID is not provided. Adjusted related logic in ExecuteCommandToolHandler and added a test case to verify this new behavior.
- Add one-time migration to set all users to backgroundExec mode
- Change default terminal execution mode from vscodeTerminal to backgroundExec
- Update UI labels to clarify background mode is recommended
- Add migration sentinel flag to prevent re-running
This migration improves the default user experience by using background
terminal execution, which provides a cleaner UI and better performance
compared to the interactive VSCode terminal mode. Existing users will be
automatically migrated once, while new users will get the improved default.
* docs(dictation): remove Windows support from system requirements
- Add note indicating dictation is currently unavailable on Windows
- Remove Windows FFmpeg installation instructions from the list
- Clarify that Windows support is planned for a future release
This update reflects the current state of the feature and sets proper user expectations about platform availability.
* Update docs/features/dictation.mdx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>