* feat(providers): add thinking level config to Vertex and Anthropic model support
- Pass thinking level configuration (plan/act mode) to Vertex provider through VertexHandlerOptions interface
- Add support for @-versioned Anthropic model IDs (e.g., claude-haiku-4-5@20251001) in cache control logic
This enables mode-specific thinking level configuration for the Vertex provider by propagating geminiPlanModeThinkingLevel and geminiActModeThinkingLevel settings based on the current mode. Also extends Anthropic model compatibility with newer versioning format.
* reasoning
* sonnet
* yield signature delta
Remove /s flag and extra quoting from cmd.exe shell arguments.
The previous approach with /s /c and quoted command was causing
issues with proper command execution in Windows cmd.exe.
* 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
* feat(telemetry): Add OpenTelemetry metrics infrastructure
Implement OpenTelemetry metrics support (counters, histograms, gauges) while maintaining backward compatibility with PostHog dashboards.
Changes:
- Updated ITelemetryProvider interface with recordCounter, recordHistogram, and recordGauge methods
- Implemented full OpenTelemetry metrics in OpenTelemetryTelemetryProvider with lazy instrument creation
- Added stub implementations in PostHogTelemetryProvider for backward compatibility
- Updated NoOpTelemetryProvider with metric method stubs
- Added comprehensive documentation in METRICS_IMPLEMENTATION_SUMMARY.md
Architecture:
- Dual instrumentation: existing PostHog events remain unchanged
- OpenTelemetry gets proper metrics for quantitative analysis
- Each provider handles metrics appropriately for its platform
Next steps:
- Add helper methods to TelemetryService for recording metrics with standard attributes
- Update high-priority capture methods (tokens, API performance) to call metric recording
- Validate with OpenTelemetry collector setup
* refactor(telemetry): add structured metrics and improve error handling
- Add userId and userEmail tracking to TelemetryService
- Implement helper methods (recordCounter, recordHistogram, recordGauge) with standardized attributes
- Add structured metrics for turns, tokens, costs, cache usage, and API performance
- Remove default case from TelemetryProviderFactory switch to enable exhaustive type checking
- Improve error handling by moving unsupported provider type logging outside switch
- Ensure all metric recordings include standard attributes (userId, email, metadata)
This refactoring enables better observability by recording key metrics (counters, histograms, gauges) across all telemetry providers while maintaining consistent attribute propagation and error isolation.
* fix: add logs back in to no-op provider
* fix: use Logger instead of console
* fix: remove unreachable code
* fix: satisfy compiler for config.type
* fix: remove metrics implementation summary
* chore: update telemetry to include mode in conversation turn events
- Added mode parameter to captureConversationTurnEvent in TelemetryService.
- Updated related telemetry metrics to include mode for better tracking.
- Adjusted tests to verify mode is correctly captured in telemetry events.
* fix: call signatures from merge detritus
* feat(telemetry): add optional description parameter to metric recording methods
Add optional `description` parameter to `recordCounter`, `recordHistogram`,
and `recordGauge` methods across the telemetry service layer. This enables
providers to include descriptive metadata when recording metrics.
Changes:
- Updated ITelemetryProvider interface methods to accept description parameter
- Modified TelemetryService private methods to pass description to providers
- Updated NoOpTelemetryProvider stub implementation
- Enhanced FakeProvider test implementation to capture descriptions
- Updated test assertions to verify description parameter handling
This change maintains backward compatibility as the description parameter
is optional.
* feat(telemetry): update recordGauge method to handle null values for metric retirement
- Modified the `recordGauge` method in `ITelemetryProvider` and its implementations to accept `null` as a valid value, allowing for the retirement of gauge series.
- Updated the `TelemetryService` to ensure proper cleanup of gauge entries when the series ends.
- Enhanced the `FakeProvider` test to validate the new behavior of gauge recording and retirement.
- Adjusted related tests to confirm that previous series are retired correctly when new values are recorded.
This change improves the management of gauge metrics, preventing stale entries and ensuring accurate telemetry data.
* refactor(telemetry): remove user email from telemetry service and related tests
- Removed the user email property from the TelemetryService and its associated methods, streamlining user attribute handling.
- Updated tests to reflect the removal of email, ensuring that metrics and events no longer rely on this attribute.
- Adjusted documentation in ITelemetryProvider to clarify the attributes used in metric recording.
This change enhances data privacy and simplifies the telemetry data model.
* feat(telemetry): enhance task metrics tracking with new counters and histograms
- Introduced new maps to track task turn counts, tool call counts, and error counts.
- Added methods to increment task counters and reset aggregates for better metric management.
- Updated existing telemetry capture methods to utilize the new counters and record histograms for task-related metrics.
- Enhanced tests to validate the new histogram entries for task turns, tool calls, and errors.
This change improves the granularity of telemetry data, allowing for more detailed analysis of task performance and error rates.
* refactor(telemetry): improve token usage handling in TelemetryService
- Updated conditions for recording cache write/read tokens and total cost to check for finite values, ensuring proper handling of undefined or null values.
- Introduced default values for token counts and total cost to prevent potential errors in metric recording.
- Enhanced readability by using descriptive variable names for token values.
This change enhances the robustness of telemetry data collection by ensuring that only valid numeric values are recorded.
* feat(telemetry): centralize metric definitions in TelemetryService
- Introduced a static METRICS object in TelemetryService to define all metric names, improving maintainability and readability.
- Updated existing telemetry recording methods to utilize the new METRICS constants, ensuring consistency across metric names.
- Enhanced tests to validate the use of METRICS constants in assertions for counters and histograms.
This change streamlines metric management and reduces the risk of errors due to hardcoded strings.
* refactor(telemetry): improve gauge observation handling in OpenTelemetryTelemetryProvider
- Replaced direct access to gauge values with a snapshot method to enhance data integrity during observable gauge callbacks.
- Introduced a new `snapshotGaugeSeries` method to encapsulate the logic for retrieving gauge data, improving code readability and maintainability.
- Updated the observable gauge callback to utilize the new snapshot method, ensuring that the latest values are accurately observed.
This change streamlines the process of observing gauge metrics, reducing potential errors and improving the overall telemetry data collection.
* refactor(telemetry): add required parameter to metric recording methods
- Updated `recordCounter`, `recordHistogram`, and `recordGauge` methods across the telemetry service and providers to include an optional `required` parameter, allowing for more flexible metric recording.
- Adjusted implementations in `NoOpTelemetryProvider`, `OpenTelemetryTelemetryProvider`, `PostHogTelemetryProvider`, and `FakeProvider` to handle the new parameter.
- Enhanced tests to validate the behavior of the `required` parameter in metric recording.
This change improves the control over metric recording conditions, enhancing the telemetry data collection process.
* fixed testing system
---------
Co-authored-by: NightTrek <Daniels@dual4t.com>
Co-authored-by: Daniel Steigman <35793213+NightTrek@users.noreply.github.com>
- Remove intermediate response extraction to preserve full error structure
- Add fallback to error.response.message and error.response.status
- Stringify error object in logException for better console output
* add a refresh guard flag (
* Implemented atomic refresh handling
Replaced the boolean flag with a Promise
- When a refresh is needed, the code first checks if _refreshPromise exists
- If it exists, concurrent calls wait for the same Promise to complete and then return the refreshed token
- If it doesn't exist, a new Promise is created and stored in _refreshPromise
- The Promise is cleared in the finally block after completion
* fix: feature-flags cache persistence during auth transitions
Restructured feature flags polling and cache management to prevent empty cache states during authentication transitions:
- Move cache timestamp update to after successful population in poll() method to ensure cache validity reflects actual data availability
- Remove cache.clear() from reset() method to preserve existing flag values until new data is fetched
- Split polling logic in AuthService to explicitly handle authenticated vs unauthenticated states
- Poll feature flags immediately after reset for authenticated users to ensure cache is populated
This prevents temporary cache misses when users log in/out while maintaining cache freshness guarantees.
* remove reset method and usage in auth flow
Remove the FeatureFlagsService.reset() method and its call during user
authentication. The feature flags polling mechanism is sufficient to
keep flags up-to-date for authenticated users without requiring an
explicit cache reset on auth state changes.
Changes:
- Remove reset() method from FeatureFlagsService
- Remove featureFlagsService.reset() call from AuthService after user identification
- Rely solely on poll() to manage feature flags cache updates
* feat: implement edit tools conversion adapter
Add logic to transform `apply_patch` tool calls into specific `write_to_file` and `replace_in_file` operations. This adapter bridges the gap between patch-based model outputs and atomic file system tools.
- Implement `transformToolCallMessages` to parse patch content:
- Converts "Add File" patches to `write_to_file`.
- Converts "Update File" patches to `replace_in_file` with search/replace blocks.
- Add logic to reconstruct tool result messages to match the expected V4A patch format (including `<final_file_content>`).
- Add comprehensive unit tests in `src/core/api/adapters/__tests__/adapters.test.ts` covering add/update operations, multiple tool blocks, and result reconstruction.
* fix typos
* typo
* 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
- Simplified plan_mode_respond instruction text by removing redundant explanations and usage field
- Fixed incorrect MODEL_FAMILY references in native-gpt-5-1 config (was using NATIVE_GPT_5 instead of NATIVE_GPT_5_1)
- Added call_id to reasoning handler output for tracking and OpenAI Response API (unreleased)
The prompt simplification makes the response parameter instruction more concise while maintaining clarity. The model family correction ensures the GPT-5-1 variant uses the correct identifier throughout.
* feat(hooks): Add hooks tab to Rules & Workflows modal
* feat(hooks): Implement hooks tab content in Rules & Workflows modal
* feat(hooks): Enable creating new hooks in modal from dropdown selection list
* feat(hooks): Change hook template scripts to use bash
* feat(hooks): Windows not yet supported for hooks, so grey-out toggle on windows
* feat(hooks): Improvements to PR as per Cline reviewing the changes before code review
* feat(hooks): Implement tests for hook management (what the UI does under the hood)
* feat(hooks): Changes as per code review feedback from humans
- Add cline-bot icon font assets (SVG, TTF, WOFF) generated from IcoMoon
- Register custom icon font in VS Code extension manifest
- Replace PNG-based command icon with font-based cline-icon
- Update terminal icon references from generic "robot" to "cline-icon"
This provides a consistent branded icon across the extension and improves visual identity by using the official Cline bot logo instead of the generic robot icon from codicon that was updated by VS Code.
* chore: clear onboarding models on deactivate
* feat(storybook): add OnboardingView story
- Added OnboardingView component to Storybook with new story
- Integrated onboarding models from shared constants
- Updated MockApp to conditionally render OnboardingView based on onboardingModels state
- Renamed WelcomeScreen story to Welcome for clarity
- Added interaction tests for onboarding buttons (Get Started/Use your own API key)
- Configured onboarding models in mock state to support new story
This enables visual testing and documentation of the user onboarding flow within Storybook.
* Update Storybook missing vscode theme color
* Update task name
* typo
* fix: parse mentions/commands in tool results and before auto-condense
**Changes:**
- Move `loadContext` call before auto-condense check to ensure slash commands and mentions are parsed before context condensing occurs
- Extract parsing logic into reusable `parseInputBlock` helper function
- Add recursive handling for `tool_result` blocks containing nested content arrays
- Remove duplicate `loadContext` calls from conditional branches
**Why:**
Previously, mentions (@file.ts) and slash commands in tool results (like attempt_completion feedback) were not expanded because parsing only handled top-level text blocks. Tool handlers return content arrays within tool_result blocks per Anthropic's API format.
Additionally, `loadContext` was called after the auto-condense check, meaning if condensing was triggered, user commands wouldn't be parsed and could be lost during summarization.
**Result:**
- All user feedback with @mentions or /commands is properly expanded regardless of nesting level
- Commands are detected before context management operations
- Cleaner code flow with single parsing point
* preserve array structure in backward-compatible tool results
When using the backward-compatible "cline" tool use ID, spread array
content directly into userMessageContent instead of wrapping it in
createToolResultBlock. This prevents array content from being
JSON.stringify'd and losing its block structure (e.g., tool_result
blocks with array content).
Previously, array content like [{type: "tool_result", content: [...]}]
was being converted to {type: "text", text: "[...]"}, which prevented
loadContext from properly parsing tool_result blocks.
* clean up
* fix(task): preserve block structure when processing string content
Instead of returning only the processed content, now properly updates the
block.content property with the processed text wrapped in an array and
returns the complete block object. This ensures the block structure is
maintained throughout the processing pipeline rather than being discarded.
* 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>
Update RuleRow component to use isDisabled for both the switch disabled state and tooltip visibility, ensuring required rules cannot be toggled off by users. Previously used separate logic that may have miscalibrated disabling for required remote rules.