* 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.
* JB Integration Workflow: use pull_request_target to support remote repo PRs
* also sanitize the branch name and title really hard to avoid json injections
* ok lets be extra double paranoid with the sanitization
* ok lets be even more extra safer by also not logging the head_ref
---------
Co-authored-by: Andrei Edell <andrei@nugbase.com>
* docs: add contributing guide for model family
Add detailed CONTRIBUTING.md documentation for system prompt configuration
and model family management. The guide covers:
- Architecture overview with key concepts (model families, variants, matchers)
- Glossary of terms (native/XML tool calling, API formats, components)
- Step-by-step instructions for creating new model families
- Configuration guides for system prompts and tool calling
- API request/response shape configuration
- Testing procedures and best practices
This documentation helps contributors understand the fallback system design
principle (GENERIC fallback) and provides practical examples for extending
support to new model providers and families.
* fix typo
---------
Co-authored-by: Robin Newhouse <robin@cline.bot>
Previously, clicking cancel would break out of the stream loop but
leave the HTTP connection open. Ollama would continue generating in
the background, keeping the GPU busy and blocking subsequent requests
until completion.
Now we call the Ollama SDK's abort() method to immediately close the
connection.
Fixes#7468
* 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
* feat: enable native tool calling for deepseek 3.2
Add isDeepSeek32ModelFamily() function to identify DeepSeek 3.2 models and integrate it into the isNextGenModelFamily() check. This classifies DeepSeek 3.2 as a next-generation model family, enabling native tool calling support.
* typo
* feat(prompt): add command output limiting guidance to capabilities
Add guidance in the system prompt instructing the model to proactively
limit command output when anticipating large results. Includes examples
like piping to grep/head/tail or using more specific arguments.
Idea by @AraTheBoss
* chore: add changeset
* refactor: move command output limiting guidance to execute_command tool
Move the guidance from capabilities.ts to execute_command.ts where it
belongs. Extract into a shared COMMAND_BEST_PRACTICES constant to avoid
duplication across model variants (GENERIC, NATIVE_GPT_5, NATIVE_NEXT_GEN,
GEMINI_3).
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.
* feat: add auto-recovery for corrupted task history state
Add automatic reconstruction of task history when JSON parsing fails.
Changes:
- Modified `reconstructTaskHistory()` to return reconstruction result or null
- Enhanced `readTaskHistoryFromState()` with automatic corruption recovery
- Added recursive reconstruction attempt with loop prevention flag
- Wrapped JSON parsing in try-catch to handle corruption gracefully
When task history state file is corrupted, the system now automatically
attempts to reconstruct history from existing task folders, providing
better resilience against file corruption issues.
* feat: Add telemetry tracking for extension storage errors
Replace console.error logging with structured telemetry capture for extension storage operations. This change:
- Adds a new EXTENSION_STORAGE_ERROR telemetry event type to track storage-related failures
- Implements captureExtensionStorageError method with error message truncation to prevent excessive data
- Replaces three console.error calls in readTaskHistoryFromState with telemetry events
This improves error monitoring and provides better insights into extension storage failures while maintaining data efficiency through message truncation.
* fix: improve type safety and error handling in task history
Add explicit return type to reconstructTaskHistory() function and refactor error handling in readTaskHistoryFromState() with nested try-catch blocks to better distinguish between file read errors and JSON parse errors. This improves error recovery and makes error tracking more precise through separate telemetry calls.
* add param to reconstructTaskHistory for manually called action
---------
Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
- Removed advanced-patterns.mdx and testing-and-debugging.mdx files
- Updated docs.json to remove these pages from navigation
- Updated hooks/index.mdx to remove corresponding Card components
- Simplified Hooks documentation to focus on core concepts: Overview, Hook Reference, and Samples
- Update package version from 3.39.1 to 3.39.2
- Upgrade @changesets/* packages to latest versions
- Update @inquirer/external-editor to 1.0.2
- Upgrade js-yaml from v3 to v4 in @changesets/parse
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
- Reorder thinking level checks to prioritize high over low
- Auto-set thinking level to LOW for Gemini 3 Pro models when not specified
- Add clarifying comment for thinking budget usage
- Ensure thinking level is always defined for Gemini 3 models to prevent errors
This change ensures Gemini 3 Pro models always have a thinking level set (required by the API) and removes the thinking budget when a level is specified, as they are mutually exclusive parameters.
* add atomic write file using write to temp file + rename to avoid situations where invalid data is written to files due to process interrupt
* adjust concurrency test for windows to expect error
* Add JSON ending to temporary file and don't await unlink
The quotes around the package name "claude-dev" in all changeset files were removed to adhere to the correct YAML format. This ensures proper parsing and consistency across the changeset files.
* v3.39.0 Release Notes
* v3.39.0 Release Notes
* feat: enhance Announcement component with new microwave model and account login functionality
- Updated Announcement component to include a new free microwave model button
- Adjusted active tab logic in OpenRouterModelPicker to default to "free" if a free model is selected
* Add demo link
---------
Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
- Remove "Configure notification settings" link and move the toggle directly into the auto-approve menu
- Remove notification setting from General Settings since it now lives in auto-approve menu
- Remove hover:opacity-80 from icon button variant to prevent dimming on hover
- Make docs link font size inherit and separator line thinner