From 9fd2b99be45f049ccc35ccbc5f8afcc80f458958 Mon Sep 17 00:00:00 2001 From: Bee <68532117+abeatrix@users.noreply.github.com> Date: Wed, 18 Feb 2026 12:43:30 -0800 Subject: [PATCH] chore: remove autoCondenseThreshold setting and related code (#9396) - Remove `auto_condense_threshold` from `Settings` and `UpdateSettingsRequest` in `state.proto`. - Remove `autoCondenseThreshold` from `ApiProviderInfo` interface. - Update `generate-state-proto.mjs` to remove double field handling and improve integer parsing. - Add error handling to `ContextManager` when parsing previous request JSON to prevent crashes on malformed data. --- proto/cline/state.proto | 9 +- scripts/generate-state-proto.mjs | 11 +- src/core/api/index.ts | 1 - .../context-management/ContextManager.ts | 41 +++--- src/core/controller/index.ts | 6 +- src/core/controller/state/updateSettings.ts | 5 - src/core/task/index.ts | 13 +- .../task/tools/subagent/SubagentRunner.ts | 5 +- src/shared/ExtensionMessage.ts | 1 - src/shared/storage/state-keys.ts | 1 - webview-ui/src/App.stories.tsx | 1 - .../chat/task-header/AutoCondenseMarker.tsx | 129 ------------------ .../chat/task-header/ContextWindow.tsx | 31 +---- .../src/context/ExtensionStateContext.tsx | 1 - 14 files changed, 36 insertions(+), 219 deletions(-) delete mode 100644 webview-ui/src/components/chat/task-header/AutoCondenseMarker.tsx diff --git a/proto/cline/state.proto b/proto/cline/state.proto index a2fa9cfcfa..2612f46db5 100644 --- a/proto/cline/state.proto +++ b/proto/cline/state.proto @@ -104,15 +104,13 @@ message Secrets { optional string oca_refresh_token = 42; optional string mcp_o_auth_secrets = 43; optional string cline_api_key = 44; - optional string openai_codex_oauth_credentials = 46; + optional string openai_codex_oauth_credentials = 47; } // NOTE: Add new fields under API_HANDLER_SETTINGS_FIELDS or USER_SETTINGS_FIELDS // in src/shared/storage/state-keys.ts and use the scripts/generate-state-proto.mjs // script to regenerate this list. message Settings { - reserved 146; // was openai_reasoning_effort (moved to mode-scoped reasoning effort) - optional string lite_llm_base_url = 1; optional bool lite_llm_use_prompt_cache = 2; optional string anthropic_base_url = 4; @@ -251,7 +249,6 @@ message Settings { optional string default_terminal_profile = 137; optional int32 terminal_output_line_limit = 138; optional int32 max_consecutive_mistakes = 139; - optional int32 subagent_terminal_output_line_limit = 140; optional bool strict_plan_mode_enabled = 141; optional bool yolo_mode_toggled = 142; optional bool use_auto_condense = 143; @@ -261,7 +258,6 @@ message Settings { optional DictationSettings dictation_settings = 148; optional FocusChainSettings focus_chain_settings = 149; optional string custom_prompt = 150; - optional double auto_condense_threshold = 151; optional bool subagents_enabled = 153; optional bool enable_parallel_tool_calling = 154; optional bool background_edit_enabled = 155; @@ -282,8 +278,8 @@ message Settings { optional int32 open_telemetry_log_max_queue_size = 171; optional bool worktrees_enabled = 172; optional bool auto_approve_all_toggled = 174; - map open_ai_headers = 175; optional bool double_check_completion_enabled = 176; + map open_ai_headers = 177; } message DictationSettings { @@ -415,7 +411,6 @@ message UpdateSettingsRequest { optional string default_terminal_profile = 21; optional bool yolo_mode_toggled = 22; optional DictationSettings dictation_settings = 23; - optional double auto_condense_threshold = 24; optional bool multi_root_enabled = 25; optional string vscode_terminal_execution_mode = 27; optional int32 max_consecutive_mistakes = 28; diff --git a/scripts/generate-state-proto.mjs b/scripts/generate-state-proto.mjs index 4b7ff5a05a..2d557f784f 100644 --- a/scripts/generate-state-proto.mjs +++ b/scripts/generate-state-proto.mjs @@ -30,7 +30,7 @@ function toProtoFieldName(str) { const INT64_FIELDS = new Set(["planModeThinkingBudgetTokens", "actModeThinkingBudgetTokens"]) // Fields that should use double instead of int32 -const DOUBLE_FIELDS = new Set(["autoCondenseThreshold"]) +const DOUBLE_FIELDS = new Set() /** * Infer proto type from TypeScript type expression @@ -254,7 +254,7 @@ function parseProtoMessageFieldNumbers(protoContent, messageName) { for (const fieldMatch of matches) { const snakeName = fieldMatch[1] - const fieldNum = parseInt(fieldMatch[2], 10) + const fieldNum = Number.parseInt(fieldMatch[2], 10) const camelName = snakeToCamel(snakeName) fieldNumbers[camelName] = fieldNum } @@ -354,11 +354,10 @@ function replaceMessage(protoContent, messageName, newMessageContent) { if (messageRegex.test(protoContent)) { return protoContent.replace(messageRegex, newMessageContent) - } else { - // Message doesn't exist, append before the first message or at end - console.warn(`Warning: ${messageName} message not found in proto file, appending`) - return protoContent + "\n\n" + newMessageContent } + // Message doesn't exist, append before the first message or at end + console.warn(`Warning: ${messageName} message not found in proto file, appending`) + return protoContent + "\n\n" + newMessageContent } async function main() { diff --git a/src/core/api/index.ts b/src/core/api/index.ts index b903c8be38..7986e2dc72 100644 --- a/src/core/api/index.ts +++ b/src/core/api/index.ts @@ -66,7 +66,6 @@ export interface ApiProviderInfo { model: ApiHandlerModel mode: Mode customPrompt?: string // "compact" - autoCondenseThreshold?: number // 0-1 range } export interface SingleCompletionHandler { diff --git a/src/core/context/context-management/ContextManager.ts b/src/core/context/context-management/ContextManager.ts index ce6784f54d..8b6b4f6920 100644 --- a/src/core/context/context-management/ContextManager.ts +++ b/src/core/context/context-management/ContextManager.ts @@ -154,15 +154,21 @@ export class ContextManager { thresholdPercentage?: number, ): boolean { if (previousApiReqIndex >= 0) { - const previousRequest = clineMessages[previousApiReqIndex] - if (previousRequest && previousRequest.text) { - const { tokensIn, tokensOut, cacheWrites, cacheReads }: ClineApiReqInfo = JSON.parse(previousRequest.text) - const totalTokens = (tokensIn || 0) + (tokensOut || 0) + (cacheWrites || 0) + (cacheReads || 0) + const previousRequestText = clineMessages[previousApiReqIndex]?.text + if (previousRequestText) { + try { + const { tokensIn, tokensOut, cacheWrites, cacheReads }: ClineApiReqInfo = JSON.parse(previousRequestText) + const totalTokens = (tokensIn || 0) + (tokensOut || 0) + (cacheWrites || 0) + (cacheReads || 0) - const { contextWindow, maxAllowedSize } = getContextWindowInfo(api) - const roundedThreshold = thresholdPercentage ? Math.floor(contextWindow * thresholdPercentage) : maxAllowedSize - const thresholdTokens = Math.min(roundedThreshold, maxAllowedSize) - return totalTokens >= thresholdTokens + const { contextWindow, maxAllowedSize } = getContextWindowInfo(api) + const roundedThreshold = thresholdPercentage + ? Math.floor(contextWindow * thresholdPercentage) + : maxAllowedSize + const thresholdTokens = Math.min(roundedThreshold, maxAllowedSize) + return totalTokens >= thresholdTokens + } catch { + return false + } } } return false @@ -195,10 +201,10 @@ export class ContextManager { } if (targetIndex >= 0) { - const targetRequest = clineMessages[targetIndex] - if (targetRequest && targetRequest.text) { + const targetRequestText = clineMessages[targetIndex]?.text + if (targetRequestText) { try { - const { tokensIn, tokensOut, cacheWrites, cacheReads }: ClineApiReqInfo = JSON.parse(targetRequest.text) + const { tokensIn, tokensOut, cacheWrites, cacheReads }: ClineApiReqInfo = JSON.parse(targetRequestText) const tokensUsed = (tokensIn || 0) + (tokensOut || 0) + (cacheWrites || 0) + (cacheReads || 0) const { contextWindow } = getContextWindowInfo(api) @@ -232,10 +238,10 @@ export class ContextManager { if (!useAutoCondense) { // If the previous API request's total token usage is close to the context window, truncate the conversation history to free up space for the new request if (previousApiReqIndex >= 0) { - const previousRequest = clineMessages[previousApiReqIndex] - if (previousRequest && previousRequest.text) { - const timestamp = previousRequest.ts - const { tokensIn, tokensOut, cacheWrites, cacheReads }: ClineApiReqInfo = JSON.parse(previousRequest.text) + const previousRequestText = clineMessages[previousApiReqIndex]?.text + if (previousRequestText) { + const timestamp = clineMessages[previousApiReqIndex].ts + const { tokensIn, tokensOut, cacheWrites, cacheReads }: ClineApiReqInfo = JSON.parse(previousRequestText) const totalTokens = (tokensIn || 0) + (tokensOut || 0) + (cacheWrites || 0) + (cacheReads || 0) const { maxAllowedSize } = getContextWindowInfo(api) @@ -846,9 +852,8 @@ export class ContextManager { } // otherwise there are still file reads here we can overwrite, so still need to process this text chunk // to do so we need to keep track of which files we've already replaced so we don't replace them again - else { - thisExistingFileReads = blockUpdates[blockUpdates.length - 1][3][0] - } + + thisExistingFileReads = blockUpdates[blockUpdates.length - 1][3][0] } } else { // for all other cases we can assume that we dont need to check this again diff --git a/src/core/controller/index.ts b/src/core/controller/index.ts index 872b315441..63f8d4c221 100644 --- a/src/core/controller/index.ts +++ b/src/core/controller/index.ts @@ -13,7 +13,7 @@ import type { ChatContent } from "@shared/ChatContent" import type { ExtensionState, Platform } from "@shared/ExtensionMessage" import type { HistoryItem } from "@shared/HistoryItem" import type { McpMarketplaceCatalog, McpMarketplaceItem } from "@shared/mcp" -import { SETTINGS_DEFAULTS, type Settings } from "@shared/storage/state-keys" +import { type Settings } from "@shared/storage/state-keys" import type { Mode } from "@shared/storage/types" import type { TelemetrySetting } from "@shared/TelemetrySetting" import type { UserInfo } from "@shared/UserInfo" @@ -894,9 +894,6 @@ export class Controller { const localCursorRulesToggles = this.stateManager.getWorkspaceStateKey("localCursorRulesToggles") const localAgentsRulesToggles = this.stateManager.getWorkspaceStateKey("localAgentsRulesToggles") const workflowToggles = this.stateManager.getWorkspaceStateKey("workflowToggles") - // Use default — the UI to adjust this is disabled and stored values may be corrupted. - // See: https://github.com/cline/cline/pull/9348 - const autoCondenseThreshold = SETTINGS_DEFAULTS.autoCondenseThreshold const currentTaskItem = this.task?.taskId ? (taskHistory || []).find((item) => item.id === this.task?.taskId) : undefined // Spread to create new array reference - React needs this to detect changes in useEffect dependencies @@ -978,7 +975,6 @@ export class Controller { taskHistory: processedTaskHistory, shouldShowAnnouncement, favoritedModelIds, - autoCondenseThreshold, backgroundCommandRunning: this.backgroundCommandRunning, backgroundCommandTaskId: this.backgroundCommandTaskId, // NEW: Add workspace information diff --git a/src/core/controller/state/updateSettings.ts b/src/core/controller/state/updateSettings.ts index c4c383b098..a337f3290c 100644 --- a/src/core/controller/state/updateSettings.ts +++ b/src/core/controller/state/updateSettings.ts @@ -301,11 +301,6 @@ export async function updateSettings(controller: Controller, request: UpdateSett controller.stateManager.setGlobalState("backgroundEditEnabled", !!request.backgroundEditEnabled) } - if (request.autoCondenseThreshold !== undefined) { - const threshold = Math.min(1, Math.max(0, request.autoCondenseThreshold)) // Clamp to 0-1 range - controller.stateManager.setGlobalState("autoCondenseThreshold", threshold) - } - if (request.multiRootEnabled !== undefined) { controller.stateManager.setGlobalState("multiRootEnabled", !!request.multiRootEnabled) } diff --git a/src/core/task/index.ts b/src/core/task/index.ts index 648d0476b0..6d8e9a7085 100644 --- a/src/core/task/index.ts +++ b/src/core/task/index.ts @@ -60,7 +60,6 @@ import { HistoryItem } from "@shared/HistoryItem" import { DEFAULT_LANGUAGE_SETTINGS, getLanguageKey, LanguageDisplay } from "@shared/Languages" import { USER_CONTENT_TAGS } from "@shared/messages/constants" import { convertClineMessageToProto } from "@shared/proto-conversions/cline-message" -import { SETTINGS_DEFAULTS } from "@shared/storage/state-keys" import { ClineDefaultTool, READ_ONLY_TOOLS } from "@shared/tools" import { ClineAskResponse } from "@shared/WebviewMessage" import { @@ -2390,14 +2389,10 @@ export class Task { } } } else { - // Use default — the UI to adjust this is disabled and stored values may be corrupted. - // See: https://github.com/cline/cline/pull/9348 - const autoCondenseThreshold = SETTINGS_DEFAULTS.autoCondenseThreshold shouldCompact = this.contextManager.shouldCompactContextWindow( this.messageStateHandler.getClineMessages(), this.api, previousApiReqIndex, - autoCondenseThreshold, ) // Edge case: summarize_task tool call completes but user cancels next request before it finishes. @@ -2530,7 +2525,7 @@ export class Task { // if last message is a partial we need to update and save it const lastMessage = this.messageStateHandler.getClineMessages().at(-1) - if (lastMessage && lastMessage.partial) { + if (lastMessage?.partial) { // lastMessage.ts = Date.now() DO NOT update ts since it is used as a key for virtuoso list lastMessage.partial = false // instead of streaming partialMessage events, we do a save and post like normal to persist to disk @@ -3518,9 +3513,7 @@ export class Task { let shouldShowContextWindow = true // For next-gen models, only show context window usage if it exceeds a certain threshold if (isNextGenModel) { - // Use default — the UI to adjust this is disabled and stored values may be corrupted. - // See: https://github.com/cline/cline/pull/9348 - const autoCondenseThreshold = SETTINGS_DEFAULTS.autoCondenseThreshold ?? 0.75 + const autoCondenseThreshold = 0.75 const displayThreshold = autoCondenseThreshold - 0.15 const currentUsageRatio = lastApiReqTotalTokens / contextWindow shouldShowContextWindow = currentUsageRatio >= displayThreshold @@ -3534,7 +3527,7 @@ export class Task { details += "\n\n# Current Mode" const mode = this.stateManager.getGlobalSettingsKey("mode") if (mode === "plan") { - details += "\nPLAN MODE\n" + formatResponse.planModeInstructions() + details += `\nPLAN MODE\n${formatResponse.planModeInstructions()}` } else { details += "\nACT MODE" } diff --git a/src/core/task/tools/subagent/SubagentRunner.ts b/src/core/task/tools/subagent/SubagentRunner.ts index 6b47aa83de..cb5f257b29 100644 --- a/src/core/task/tools/subagent/SubagentRunner.ts +++ b/src/core/task/tools/subagent/SubagentRunner.ts @@ -12,7 +12,6 @@ import type { SystemPromptContext } from "@core/prompts/system-prompt/types" import { StreamResponseHandler } from "@core/task/StreamResponseHandler" import { ClineAssistantToolUseBlock, ClineStorageMessage, ClineTextContentBlock } from "@shared/messages" import { Logger } from "@shared/services/Logger" -import { SETTINGS_DEFAULTS } from "@shared/storage/state-keys" import type { ClineTool } from "@shared/tools" import { ClineDefaultTool } from "@shared/tools" import { isNextGenModelFamily } from "@utils/model-utils" @@ -738,9 +737,7 @@ export class SubagentRunner { const { contextWindow, maxAllowedSize } = getContextWindowInfo(api) const useAutoCondense = this.baseConfig.services.stateManager.getGlobalSettingsKey("useAutoCondense") if (useAutoCondense && isNextGenModelFamily(modelId)) { - // Use default — the UI to adjust this is disabled and stored values may be corrupted. - // See: https://github.com/cline/cline/pull/9348 - const autoCondenseThreshold = SETTINGS_DEFAULTS.autoCondenseThreshold + const autoCondenseThreshold = 0.75 const roundedThreshold = autoCondenseThreshold ? Math.floor(contextWindow * autoCondenseThreshold) : maxAllowedSize const thresholdTokens = Math.min(roundedThreshold, maxAllowedSize) return previousRequestTotalTokens >= thresholdTokens diff --git a/src/shared/ExtensionMessage.ts b/src/shared/ExtensionMessage.ts index 07350806e5..b850e2b014 100644 --- a/src/shared/ExtensionMessage.ts +++ b/src/shared/ExtensionMessage.ts @@ -91,7 +91,6 @@ export interface ExtensionState { focusChainSettings: FocusChainSettings dictationSettings: DictationSettings customPrompt?: string - autoCondenseThreshold?: number favoritedModelIds: string[] // NEW: Add workspace information workspaceRoots: WorkspaceRoot[] diff --git a/src/shared/storage/state-keys.ts b/src/shared/storage/state-keys.ts index e9431e2993..6ae1605cf9 100644 --- a/src/shared/storage/state-keys.ts +++ b/src/shared/storage/state-keys.ts @@ -266,7 +266,6 @@ const USER_SETTINGS_FIELDS = { }, focusChainSettings: { default: DEFAULT_FOCUS_CHAIN_SETTINGS as FocusChainSettings }, customPrompt: { default: undefined as "compact" | undefined }, - autoCondenseThreshold: { default: 0.75 as number }, // number from 0 to 1 enableParallelToolCalling: { default: true as boolean }, backgroundEditEnabled: { default: false as boolean }, optOutOfRemoteConfig: { default: false as boolean }, diff --git a/webview-ui/src/App.stories.tsx b/webview-ui/src/App.stories.tsx index 060f694ff5..1a19bf3f65 100644 --- a/webview-ui/src/App.stories.tsx +++ b/webview-ui/src/App.stories.tsx @@ -240,7 +240,6 @@ const mockStreamingMessages: ClineMessage[] = [ const createMockState = (overrides: any = {}) => ({ ...useExtensionState(), useAutoCondense: true, - autoCondenseThreshold: 0.5, version: "0.0.1-stories", welcomeViewCompleted: true, showWelcome: false, diff --git a/webview-ui/src/components/chat/task-header/AutoCondenseMarker.tsx b/webview-ui/src/components/chat/task-header/AutoCondenseMarker.tsx deleted file mode 100644 index 81970dca32..0000000000 --- a/webview-ui/src/components/chat/task-header/AutoCondenseMarker.tsx +++ /dev/null @@ -1,129 +0,0 @@ -import { cn } from "@heroui/react" -import React, { useEffect, useMemo, useRef, useState } from "react" - -export const AutoCondenseMarker: React.FC<{ - threshold: number - usage: number - isContextWindowHoverOpen?: boolean - shouldAnimate?: boolean -}> = ({ threshold, usage, isContextWindowHoverOpen, shouldAnimate = false }) => { - const [isAnimating, setIsAnimating] = useState(false) - const [animatedPosition, setAnimatedPosition] = useState(0) - const [showPercentageAfterAnimation, setShowPercentageAfterAnimation] = useState(false) - const [isFadingOut, setIsFadingOut] = useState(false) - - // Refs to store animation frame and timeout IDs for cleanup - const animationFrameRef = useRef(null) - const fadeOutTimeoutRef = useRef(null) - const hideTimeoutRef = useRef(null) - - // Animation effect when shouldAnimate prop changes (initial load) - useEffect(() => { - // Cleanup function to cancel any pending animations or timeouts - const cleanup = () => { - if (animationFrameRef.current !== null) { - cancelAnimationFrame(animationFrameRef.current) - animationFrameRef.current = null - } - if (fadeOutTimeoutRef.current !== null) { - clearTimeout(fadeOutTimeoutRef.current) - fadeOutTimeoutRef.current = null - } - if (hideTimeoutRef.current !== null) { - clearTimeout(hideTimeoutRef.current) - hideTimeoutRef.current = null - } - } - - if (shouldAnimate && threshold > 0) { - // Clean up any existing animations before starting new one - cleanup() - - setIsAnimating(true) - const targetPosition = threshold * 100 - const duration = 1200 // ms - slowed down from 800ms - const startTime = Date.now() - - const animate = () => { - const elapsed = Date.now() - startTime - const progress = Math.min(elapsed / duration, 1) - // Ease-out animation curve - const easeOut = 1 - (1 - progress) ** 3 - const currentPosition = easeOut * targetPosition - setAnimatedPosition(currentPosition) - - if (progress < 1) { - animationFrameRef.current = requestAnimationFrame(animate) - } else { - animationFrameRef.current = null - setIsAnimating(false) - setShowPercentageAfterAnimation(true) - // Start fade out after 1 second - fadeOutTimeoutRef.current = setTimeout(() => { - setIsFadingOut(true) - // Completely hide after fade transition - hideTimeoutRef.current = setTimeout(() => { - setShowPercentageAfterAnimation(false) - setIsFadingOut(false) - hideTimeoutRef.current = null - setAnimatedPosition(threshold * 100) // Ensure it ends exactly at threshold - }, 300) // 300ms fade duration - fadeOutTimeoutRef.current = null - }, 1000) - } - } - - animationFrameRef.current = requestAnimationFrame(animate) - } - - // Cleanup on unmount or when dependencies change - return cleanup - }, [shouldAnimate, threshold]) - - // The marker position is calculated based on the threshold percentage - // It goes over the progress bar to indicate where the auto-condense will trigger - // and it should highlight from what the current percentage (usage) is - // to the threshold percentage - const marker = useMemo(() => { - const _threshold = threshold * 100 - // Always use the current threshold for position and label - animation only affects visual movement - const position = _threshold - const startingPosition = isAnimating ? animatedPosition : position - - return { - start: startingPosition + "%", - label: startingPosition.toFixed(0), - end: usage > startingPosition ? usage - startingPosition + "%" : 0, - } - }, [threshold, usage, isAnimating, animatedPosition]) - - if (!threshold) { - return null - } - - return ( -
-
- {(isContextWindowHoverOpen || isAnimating || showPercentageAfterAnimation) && ( -
- {marker.label}% -
- )} -
-
- ) -} -AutoCondenseMarker.displayName = "AutoCondenseMarker" diff --git a/webview-ui/src/components/chat/task-header/ContextWindow.tsx b/webview-ui/src/components/chat/task-header/ContextWindow.tsx index 29a5d2b6fb..e63a43c270 100644 --- a/webview-ui/src/components/chat/task-header/ContextWindow.tsx +++ b/webview-ui/src/components/chat/task-header/ContextWindow.tsx @@ -4,7 +4,6 @@ import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from " import { HoverCard, HoverCardContent, HoverCardTrigger } from "@/components/ui/hover-card" import { Progress } from "@/components/ui/progress" import { formatLargeNumber as formatTokenNumber } from "@/utils/format" -import { AutoCondenseMarker } from "./AutoCondenseMarker" import CompactTaskButton from "./buttons/CompactTaskButton" import { ContextWindowSummary } from "./ContextWindowSummary" @@ -21,7 +20,6 @@ interface ContextWindowProgressProps extends ContextWindowInfoProps { useAutoCondense: boolean lastApiReqTotalTokens?: number contextWindow?: number - autoCondenseThreshold?: number onSendMessage?: (command: string, files: string[], images: string[]) => void } @@ -57,7 +55,6 @@ ConfirmationDialog.displayName = "ConfirmationDialog" const ContextWindow: React.FC = ({ contextWindow = 0, lastApiReqTotalTokens = 0, - autoCondenseThreshold = 0.75, onSendMessage, useAutoCondense, tokensIn, @@ -66,25 +63,8 @@ const ContextWindow: React.FC = ({ cacheReads, }) => { const [isOpened, setIsOpened] = useState(false) - const [threshold, setThreshold] = useState(useAutoCondense ? autoCondenseThreshold : 0) const [confirmationNeeded, setConfirmationNeeded] = useState(false) const progressBarRef = useRef(null) - const [shouldAnimateMarker, setShouldAnimateMarker] = useState(false) - - // Trigger marker animation when component first mounts (TaskHeader expands) - useEffect(() => { - if (useAutoCondense && threshold > 0) { - setShouldAnimateMarker(true) - // Reset animation flag after animation completes - const timer = setTimeout(() => { - setShouldAnimateMarker(false) - }, 1400) // Slightly longer than animation duration (1200ms + buffer) - return () => clearTimeout(timer) - } - }, []) // Empty dependency array means this only runs on mount - - // TODO: Implement click-to-set-threshold and keyboard adjustment for auto-condense. - // Disabled in https://github.com/cline/cline/pull/9348 — see that PR for the original code. const handleCompactClick = useCallback( (e: React.MouseEvent) => { @@ -138,7 +118,7 @@ const ContextWindow: React.FC = ({ useEffect(() => { const handleClickOutside = (event: MouseEvent) => { const target = event.target as Element - const isInsideProgressBar = progressBarRef.current && progressBarRef.current.contains(target as Node) + const isInsideProgressBar = progressBarRef.current?.contains(target as Node) // Check if click is inside any tooltip content by looking for our custom class const isInsideTooltipContent = target.closest(".context-window-tooltip-content") !== null @@ -169,7 +149,6 @@ const ContextWindow: React.FC = ({ = ({ color="success" value={tokenData.percentage} /> - {useAutoCondense && ( - - )} {isOpened} diff --git a/webview-ui/src/context/ExtensionStateContext.tsx b/webview-ui/src/context/ExtensionStateContext.tsx index 68f1fe4275..9f6eeb7f07 100644 --- a/webview-ui/src/context/ExtensionStateContext.tsx +++ b/webview-ui/src/context/ExtensionStateContext.tsx @@ -268,7 +268,6 @@ export const ExtensionStateContextProvider: React.FC<{ subagentsEnabled: false, clineWebToolsEnabled: { user: true, featureFlag: false }, worktreesEnabled: { user: true, featureFlag: false }, - autoCondenseThreshold: undefined, favoritedModelIds: [], lastDismissedInfoBannerVersion: 0, lastDismissedModelBannerVersion: 0,