* 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
* 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.
* feat: add OpenAI Response API support and Codex model compatibility
- Add ApiFormat enum to proto definitions with OPENAI_RESPONSES format
- Update model info messages to include api_format field across providers
- Refactor OpenAI native handler to conditionally use Response API based on model's api_format
- Add Codex model support in GPT-5 and GPT-5-1 prompt variants with appropriate exclusions
- Remove hardcoded useResponseFormat parameter in favor of model-driven API selection
This enables ChatGPT Codex models to use the Response API format when tools are provided, while maintaining backward compatibility with existing chat completion models.
* add comments
* tabs
When API requests fail and auto-retry is enabled, multiple error_retry
messages were shown (e.g., "Attempt 1 of 3", "Attempt 2 of 3", etc.).
This change consolidates them to only show the latest retry message,
reducing visual clutter during retry sequences.
Fixed the message structure to match the OpenAI Responses API format.
Updated Message ID placement: The message id is stored and set at the message level, not inside the content array.
This fixes an error occuring in the current code when reasoning item is followed by a message text block: 400 Item 'rs_...' of type 'reasoning' was provided without its required following item."
* feat(storage): add mode and token metrics to storage messages
Add mode (plan/act) tracking to ApiProviderInfo and ClineMessageModelInfo interfaces, ensuring each storage message contains the operational mode used during API requests.
Refactor token metrics tracking by consolidating cache write/read tokens, input/output tokens, and total cost into a centralized taskMetrics object. This enables better tracking and storage of token usage and costs throughout the task lifecycle, including for partial/cancelled streams.
Updated api_req_started and api_req_finished messages to include comprehensive token metrics, allowing for accurate cost reporting even when streams are cancelled or fail mid-execution.
* update unit tests with mode
* store task metrics per assistant turn
* fix(hooks): Trigger UserPromptSubmit hook when continuing a completed task
* fix(hooks): Make prompt formating consistent for all UserPromptSubmit entrypoints
* fix(hooks): Code reviewing w/ Cline before submitting PR for human review
* fix(hooks): Improve type safety
* fix(hooks): Add unit tests for buildUserFeedbackContent
* fix(hooks): Minor Cline code review changes
* fix(hooks): Fix test assertion technique
* fix(hooks): Simplify PR
* feat(hooks): Consolidate constants to a shared location as per PR feedback
* feat: add banners ui, dismissal state handling and event log
* feat: add cli as ide type, clean up some code
* feat: wire up controller and UI for banners
* audit every rule check to ensure it is doing correct filtering and working locally
* seperate out frontend code
* clean up
* fix proto file
* fix quality check errors
* fix banner service tests
* feat: use json polling approach for active banners
* fix: build error
* fix ci
* fix quality check
* use BannerService.isInitialized() instead
* do not log error when banner array is empty, only when missing or not defined
* do not hash instance id
* add dynamic model fetching for litellm provider and get rid of manual model config; also implement dynamic modelinfo lookup
* don't clear the models list when a fetch fails
* fix: ensure reasoning signature is accessible at top level
Extract signature from nested summary object and promote it to the top-level
reasoning structure when not already present. This ensures consistent access
to the signature field across all providers, regardless of where it's initially
provided in the reasoning details. The fomatter that each provider runs would then reconstruct the messages in the format they need.
* clean up
* kimik2 thinking added to static model dropdown
* numerical separators
* don't set kimi k2 thinking as default
---------
Co-authored-by: AlexKer <AlexKer@users.noreply.github.com>
* fix: Centralize reasoning details within thinking blocks
This commit refactors how reasoning details are managed across the system, integrating them directly into `ClineAssistantThinkingBlock` to improve consistency and reduce complexity.
Previously, `reasoning_details` were often explicitly deleted or inconsistently handled, leading to their loss or difficulty in tracking. This change ensures that reasoning details are always associated with their corresponding thinking blocks.
Key changes include:
- `StreamResponseHandler`: The `ReasoningHandler`'s `getCurrentReasoning` method now directly returns a `ClineAssistantThinkingBlock` which encapsulates the reasoning content and its `summary` (formerly `details`). The separate `getThinkingBlock` method has been removed.
- `convertToOpenAiMessages`: Explicit deletion of `part.reasoning_details` for `thinking` parts is replaced by setting it to `undefined` with a comment, indicating that these details are now expected to be part of the thinking block in the stream.
- `Task`: Simplified streaming logic by directly consuming the `ClineAssistantThinkingBlock` from `reasonsHandler.getCurrentReasoning()`. Redundant temporary variables for reasoning content and details have been removed.
This refactoring centralizes the management of reasoning details, providing a more robust and streamlined approach to handling assistant thinking processes.
* fix(api): attach reasoning details to tool blocks and improve logging
Updates validity of reasoning details within tool blocks and enhances debugging visibility.
- Modify `StreamResponseHandler` to append reasoning details/summary to finalized tool use blocks.
- Update `convertToOpenAiMessages` to extract and aggregate `reasoning_details` from tool messages instead of discarding them.
- Add `Logger.debug` calls in `ClineHandler` and OpenAI transformation for better observability of message chunks and conversion.
- Remove redundant `continue` statements in `ClineHandler` stream processing loop.
* clean up
* remove Logger
* feat: add support for Responses API for openai-native provider [ENG-1227]
- Upgrade openai dependency to v6.9.0 to use the Responses API
- Implement internal handling for reasoning/thinking and redacted output
- Align Anthropic handler message types with the latest SDK interfaces
- Clean up obsolete tooling imports related to tool-use handling
- Enable newer OpenAI capabilities while keeping provider APIs consistent
* Add openai_native_response_api feature flag
* clean up
* clean up 2
* add back gpt-5.1 models
* use call_id
- Add `google/gemini-3-pro-preview` to `CLINE_ONBOARDING_MODELS`.
- Configure model details including context window, pricing, and capabilities (images, prompt cache).
- Enable users to select the new Gemini 3.0 Pro model during setup.
* feat: add thought signature support for Gemini SDK
Update @google/genai dependency from v1.15.0 to v1.30.0, including nested deps like google-auth-library. Enhance API interfaces with JSDoc comments and new fields such as signature, id, and redacted_data in ApiStreamThinkingChunk to support thought signatures from Gemini SDK as requested. This improves integration with Gemini's reasoning capabilities and ensures compatibility with updated SDK features.
* add changeset
* meaning val check
* typo
* either
* Do not use think budget with gemini-3
* 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
* 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>
* 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>
* 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
* 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>
* 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
* feat(auth): new onboarding UI
- Add optional `strict` parameter to `createAuthRequest()` to prevent opening new auth windows when already authenticated
- Update onboarding flow with new UI text and button labels ("Login to Cline", "I have my own key", "Ready")
- Add new onboarding data models and step configuration for improved user experience
- Update all e2e tests to reflect new button labels and authentication flow
- Remove obsolete `closeBanners` utility function
- Refactor authentication logic to support strict mode for better control over auth window behavior
This change improves the authentication UX by preventing duplicate auth windows and provides a more streamlined onboarding experience with clearer call-to-action buttons.
* Debug buttons
* Update model list
* Add search box
* improve model selection with names and improved search
- Add name field to ModelInfo interface for better model identification
- Populate model name from OpenRouter API response
- Improve model search filtering to exclude embedding models
- Add case-insensitive search for better UX
- Enhance UI with badges for model capabilities and pricing
- Update styling for better visual hierarchy and selected state
- Display model names in search results for clarity
This improves the onboarding experience by making model selection more informative and user-friendly with better search capabilities and visual feedback.
* clean up
* async onboarding
* Update langauge
* spacing
* search result info text
* update e2e test
* update badge
* style(onboarding): adjust max-width constraint placement
Move max-width constraint from parent container to content wrapper div to improve responsive layout behavior. This ensures the full width is utilized at the top level while constraining only the scrollable content area.
Changes:
- Added w-full to root container for proper width handling
- Removed max-w-lg from middle container
- Applied max-w-lg to content wrapper instead
* Update search box placeholder text
* remove unused description field
* clean up
* Fix search box reset state
* feat: add loading screen to onboarding flow
- Add loading state (step 2) during authentication process
- Simplify welcomeViewCompleted logic by removing auth service check
- Move welcomeViewCompleted state update to auth success handler
- Display loading spinner during sign-in to improve UX
- Ensure auth status update occurs in finally block for reliability
The loading screen provides visual feedback while authentication completes, preventing users from seeing incomplete UI states during the sign-in process.
* update AuthServiceMock
* capture onboarding events
* smaller badge radius
* radius-xs = 4px & add speed label
* update to MiniMax M2