From 1cead2c9067e428bdc496e9327fb3a26f8fb3ca5 Mon Sep 17 00:00:00 2001 From: JATMN Date: Tue, 27 Oct 2026 10:06:54 -0700 Subject: [PATCH] fix: remove next 40 unused local findings (batch 4) (#2456) --- src/buddy/actionEffects.ts | 1 - src/commands/effort/effort.tsx | 5 ++- src/commands/provider/provider.test.tsx | 1 - src/commands/replay/replay.tsx | 15 -------- src/components/MessageSelector.tsx | 2 +- src/components/NativeAutoUpdater.tsx | 1 - .../PromptInput/PromptInputFooterLeftSide.tsx | 1 - src/components/ProviderManager.tsx | 2 +- src/components/agents/AgentsMenu.tsx | 1 - src/components/agents/ToolSelector.tsx | 1 - src/components/messages/AttachmentMessage.tsx | 7 +--- src/components/messages/SystemTextMessage.tsx | 35 ------------------- src/components/tasks/taskStatusUtils.tsx | 1 - src/cost-tracker.ts | 6 ---- src/entrypoints/init.ts | 4 +-- src/hooks/fileSuggestions.test.ts | 33 ----------------- src/hooks/toolPermission/PermissionContext.ts | 1 - src/hooks/useCanUseTool.tsx | 1 - src/integrations/registry.test.ts | 1 - src/screens/REPL.tsx | 2 +- src/screens/replMaxTurnsProp.test.ts | 1 - src/services/api/errors.ts | 1 - src/services/api/openaiShim.test.ts | 1 - src/services/tools/toolExecution.ts | 4 --- src/services/wiki/conventions.test.ts | 2 +- src/tools/BashTool/bashPermissions.ts | 1 - src/utils/analyzeContext.ts | 1 - src/utils/cronJitterConfig.ts | 12 ++----- src/utils/doctorDiagnostic.ts | 9 ----- src/utils/interruptionCorrection.test.ts | 5 +-- src/utils/permissions/filesystem.ts | 2 +- src/utils/permissions/permissions.ts | 5 +-- src/utils/promptShellExecution.ts | 2 +- .../sessionStorage.atomicReplace.test.ts | 1 - tests/sdk/generated-types.test.ts | 3 -- 35 files changed, 14 insertions(+), 157 deletions(-) diff --git a/src/buddy/actionEffects.ts b/src/buddy/actionEffects.ts index 34c9d1c67..ae1b08f63 100644 --- a/src/buddy/actionEffects.ts +++ b/src/buddy/actionEffects.ts @@ -103,7 +103,6 @@ const arrowFx: ActionEffect = { } // ── Kaio: charging orb, then a full-width energy wave ────────────────── -const ORB_FRAMES = ['∘', '○', '◎', '●'] const kaioFx: ActionEffect = { drawMs: 500, // longer charge — the orb grows during this phase travelMs: 700, diff --git a/src/commands/effort/effort.tsx b/src/commands/effort/effort.tsx index 902dffcdb..90e1b1a92 100644 --- a/src/commands/effort/effort.tsx +++ b/src/commands/effort/effort.tsx @@ -4,7 +4,7 @@ import { useMainLoopModel } from '../../hooks/useMainLoopModel.js'; import { type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, logEvent } from '../../services/analytics/index.js'; import { useAppState, useSetAppState } from '../../state/AppState.js'; import type { LocalJSXCommandOnDone } from '../../types/command.js'; -import { type EffortValue, clampUltracodeEffort, getAvailableEffortLevels, getDisplayedEffortLevel, getEffortEnvOverride, getEffortValueDescription, isEffortLevel, isOpenAIEffortLevel, modelUsesOpenAIEffort, openAIEffortToStandard, toPersistableEffort } from '../../utils/effort.js'; +import { type EffortValue, clampUltracodeEffort, getAvailableEffortLevels, getDisplayedEffortLevel, getEffortEnvOverride, getEffortValueDescription, isEffortLevel, isOpenAIEffortLevel, openAIEffortToStandard, toPersistableEffort } from '../../utils/effort.js'; import { EffortPicker } from '../../components/EffortPicker.js'; import { updateSettingsForSource } from '../../utils/settings/settings.js'; const COMMON_HELP_ARGS = ['help', '-h', '--help']; @@ -206,8 +206,7 @@ export async function call(onDone: LocalJSXCommandOnDone, _context: unknown, arg function EffortPickerWrapper({ onDone }: { onDone: LocalJSXCommandOnDone }) { const setAppState = useSetAppState(); - const model = useMainLoopModel(); - const usesOpenAIEffort = modelUsesOpenAIEffort(model); + useMainLoopModel(); function handleSelect(effort: EffortValue | undefined) { const result = effort === undefined ? unsetEffortLevel() : setEffortValue(effort); diff --git a/src/commands/provider/provider.test.tsx b/src/commands/provider/provider.test.tsx index ee51c9757..ac810b7d4 100644 --- a/src/commands/provider/provider.test.tsx +++ b/src/commands/provider/provider.test.tsx @@ -7,7 +7,6 @@ import { stripVTControlCharacters as stripAnsi } from 'node:util' import { type Instance, createRoot, render, useApp } from '../../ink.js' import { AppStateProvider } from '../../state/AppState.js' import { - applySavedProfileToCurrentSession, buildCodexOAuthProfileEnv, buildCurrentProviderSummary, buildProfileSaveMessage, diff --git a/src/commands/replay/replay.tsx b/src/commands/replay/replay.tsx index 81fa05066..aef055d8e 100644 --- a/src/commands/replay/replay.tsx +++ b/src/commands/replay/replay.tsx @@ -15,23 +15,8 @@ import { loadReplayIndex } from '../../utils/replayIndex.js'; import { getWorktreePaths } from '../../utils/getWorktreePaths.js'; import { getSessionIdFromLog, getTranscriptPathForSession, isLiteLog, loadFullLog, loadSameRepoMessageLogs } from '../../utils/sessionStorage.js'; import { validateUuid } from '../../utils/uuid.js'; -import { agenticSessionSearch } from '../../utils/agenticSessionSearch.js'; import { ReplayTimeline } from './ReplayTimeline.js'; -function formatDuration(ms: number): string { - if (ms < 1000) return `${ms}ms` - if (ms < 60000) return `${(ms / 1000).toFixed(1)}s` - const minutes = Math.floor(ms / 60000) - const seconds = Math.floor((ms % 60000) / 1000) - return `${minutes}m ${seconds}s` -} - -function formatToolBreakdown(breakdown: Record): string { - return Object.entries(breakdown) - .map(([tool, count]) => `${count} ${tool}`) - .join(', ') -} - async function findLogBySessionId(sessionId: UUID): Promise { const logs = await loadSameRepoMessageLogs(await getWorktreePaths(getOriginalCwd())); return logs.find(log => getSessionIdFromLog(log) === sessionId); diff --git a/src/components/MessageSelector.tsx b/src/components/MessageSelector.tsx index 4cd5a6d6a..daa493df5 100644 --- a/src/components/MessageSelector.tsx +++ b/src/components/MessageSelector.tsx @@ -88,7 +88,7 @@ export function MessageSelector({ // Per-option feedback state; Select's internal inputValues Map persists // per-option text independently, so sharing one variable would desync. const [summarizeFromFeedback, setSummarizeFromFeedback] = useState(''); - const [summarizeUpToFeedback, setSummarizeUpToFeedback] = useState(''); + const [summarizeUpToFeedback] = useState(''); // Generate options with summarize as input type for inline context function getRestoreOptions(canRestoreCode: boolean): OptionWithDescription[] { diff --git a/src/components/NativeAutoUpdater.tsx b/src/components/NativeAutoUpdater.tsx index 33fbbe257..82e03e922 100644 --- a/src/components/NativeAutoUpdater.tsx +++ b/src/components/NativeAutoUpdater.tsx @@ -1,7 +1,6 @@ import * as React from 'react'; import { useEffect, useRef, useState } from 'react'; import { logEvent } from 'src/services/analytics/index.js'; -import { logForDebugging } from 'src/utils/debug.js'; import { logError } from 'src/utils/log.js'; import { useInterval } from 'usehooks-ts'; import { useUpdateNotification } from '../hooks/useUpdateNotification.js'; diff --git a/src/components/PromptInput/PromptInputFooterLeftSide.tsx b/src/components/PromptInput/PromptInputFooterLeftSide.tsx index 8b5f736b3..70cd3f3eb 100644 --- a/src/components/PromptInput/PromptInputFooterLeftSide.tsx +++ b/src/components/PromptInput/PromptInputFooterLeftSide.tsx @@ -15,7 +15,6 @@ import { isVimModeEnabled } from './utils.js'; import { useShortcutDisplay } from '../../keybindings/useShortcutDisplay.js'; import { isDefaultMode, permissionModeSymbol, permissionModeTitle, getModeColor } from '../../utils/permissions/PermissionMode.js'; import { BackgroundTaskStatus } from '../tasks/BackgroundTaskStatus.js'; -import { isBackgroundTask } from '../../tasks/types.js'; import { count } from '../../utils/array.js'; import { countVisibleBackgroundTasks, shouldHideTasksFooter } from '../tasks/taskStatusUtils.js'; import { isAgentSwarmsEnabled } from '../../utils/agentSwarmsEnabled.js'; diff --git a/src/components/ProviderManager.tsx b/src/components/ProviderManager.tsx index 0bb1d13eb..fe7df35e9 100644 --- a/src/components/ProviderManager.tsx +++ b/src/components/ProviderManager.tsx @@ -20,7 +20,7 @@ import { parseProfileCustomHeadersInput, serializeProfileCustomHeaders, } from '../utils/providerCustomHeaders.js' -import { getPrimaryModel, hasMultipleModels, parseModelList } from '../utils/providerModels.js' +import { getPrimaryModel, parseModelList } from '../utils/providerModels.js' import { applySavedProfileToCurrentSession, buildCodexOAuthProfileEnv, diff --git a/src/components/agents/AgentsMenu.tsx b/src/components/agents/AgentsMenu.tsx index 850e9a96e..531d6e18f 100644 --- a/src/components/agents/AgentsMenu.tsx +++ b/src/components/agents/AgentsMenu.tsx @@ -15,7 +15,6 @@ import { toError } from '../../utils/errors.js'; import { logError } from '../../utils/log.js'; import { Select } from '../CustomSelect/select.js'; import { Dialog } from '../design-system/Dialog.js'; -import { AgentDetail } from './AgentDetail.js'; import { AgentDetailDialog } from './AgentDetailDialog.js'; import { AgentEditor } from './AgentEditor.js'; import { AgentNavigationFooter } from './AgentNavigationFooter.js'; diff --git a/src/components/agents/ToolSelector.tsx b/src/components/agents/ToolSelector.tsx index ed5c9bae1..e7085239a 100644 --- a/src/components/agents/ToolSelector.tsx +++ b/src/components/agents/ToolSelector.tsx @@ -19,7 +19,6 @@ import { ReadMcpResourceTool } from 'src/tools/ReadMcpResourceTool/ReadMcpResour import { TaskOutputTool } from 'src/tools/TaskOutputTool/TaskOutputTool.js'; import { TaskStopTool } from 'src/tools/TaskStopTool/TaskStopTool.js'; import { TodoWriteTool } from 'src/tools/TodoWriteTool/TodoWriteTool.js'; -import { TungstenTool } from 'src/tools/TungstenTool/TungstenTool.js'; import { WebFetchTool } from 'src/tools/WebFetchTool/WebFetchTool.js'; import { WebSearchTool } from 'src/tools/WebSearchTool/WebSearchTool.js'; import type { KeyboardEvent } from '../../ink/events/keyboard-event.js'; diff --git a/src/components/messages/AttachmentMessage.tsx b/src/components/messages/AttachmentMessage.tsx index 8f42783e3..72aee5a2f 100644 --- a/src/components/messages/AttachmentMessage.tsx +++ b/src/components/messages/AttachmentMessage.tsx @@ -1,6 +1,6 @@ import { c as _c } from "react-compiler-runtime"; // biome-ignore-all assist/source/organizeImports: internal-only import markers must not be reordered -import React, { useMemo } from 'react'; +import React from 'react'; import { Ansi, Box, Text } from '../../ink.js'; import type { Attachment } from 'src/utils/attachments.js'; import type { NullRenderingAttachmentType } from './nullRenderingAttachments.js'; @@ -17,7 +17,6 @@ import { UserImageMessage } from './UserImageMessage.js'; import { toInkColor } from '../../utils/ink.js'; import { jsonParse } from '../../utils/slowOperations.js'; import { plural } from '../../utils/stringUtils.js'; -import { isEnvTruthy } from '../../utils/envUtils.js'; import { isAgentSwarmsEnabled } from '../../utils/agentSwarmsEnabled.js'; import { tryRenderPlanApprovalMessage, formatTeammateMessageContent } from './PlanApprovalMessage.js'; import { BLACK_CIRCLE } from '../../constants/figures.js'; @@ -41,10 +40,6 @@ export function AttachmentMessage({ isTranscriptMode }: Props): React.ReactNode { const bg = useSelectedMessageBg(); - // Hoisted to mount-time — per-message component, re-renders on every scroll. - const isDemoEnv = feature('EXPERIMENTAL_SKILL_SEARCH') ? - // biome-ignore lint/correctness/useHookAtTopLevel: feature() is a compile-time constant - useMemo(() => isEnvTruthy(process.env.IS_DEMO), []) : false; // Handle teammate_mailbox BEFORE switch if (isAgentSwarmsEnabled() && attachment.type === 'teammate_mailbox') { // Filter out idle notifications BEFORE counting - they are hidden in the UI diff --git a/src/components/messages/SystemTextMessage.tsx b/src/components/messages/SystemTextMessage.tsx index 52f4a5d61..765006af3 100644 --- a/src/components/messages/SystemTextMessage.tsx +++ b/src/components/messages/SystemTextMessage.tsx @@ -733,41 +733,6 @@ function MemoryFileRow(t0) { } return t8; } -function ThinkingMessage(t0) { - const $ = _c(7); - const { - message, - addMargin - } = t0; - const bg = useSelectedMessageBg(); - const t1 = addMargin ? 1 : 0; - let t2; - if ($[0] === Symbol.for("react.memo_cache_sentinel")) { - t2 = {TEARDROP_ASTERISK}; - $[0] = t2; - } else { - t2 = $[0]; - } - let t3; - if ($[1] !== message.content) { - t3 = {message.content}; - $[1] = message.content; - $[2] = t3; - } else { - t3 = $[2]; - } - let t4; - if ($[3] !== bg || $[4] !== t1 || $[5] !== t3) { - t4 = {t2}{t3}; - $[3] = bg; - $[4] = t1; - $[5] = t3; - $[6] = t4; - } else { - t4 = $[6]; - } - return t4; -} function BridgeStatusMessage(t0) { const $ = _c(13); const { diff --git a/src/components/tasks/taskStatusUtils.tsx b/src/components/tasks/taskStatusUtils.tsx index d2bca0613..2af5d36ce 100644 --- a/src/components/tasks/taskStatusUtils.tsx +++ b/src/components/tasks/taskStatusUtils.tsx @@ -5,7 +5,6 @@ import figures from 'figures'; import type { TaskStatus } from 'src/Task.js'; import type { InProcessTeammateTaskState } from 'src/tasks/InProcessTeammateTask/types.js'; -import { isPanelAgentTask } from 'src/tasks/LocalAgentTask/LocalAgentTask.js'; import { isBackgroundTask, type TaskState } from 'src/tasks/types.js'; import type { DeepImmutable } from 'src/types/utils.js'; import { summarizeRecentActivities } from 'src/utils/collapseReadSearch.js'; diff --git a/src/cost-tracker.ts b/src/cost-tracker.ts index de88b5c87..d9418dd33 100644 --- a/src/cost-tracker.ts +++ b/src/cost-tracker.ts @@ -50,7 +50,6 @@ import { getContextWindowForModel, getModelMaxOutputTokens, } from './utils/context.js' -import { isFastModeEnabled } from './utils/fastMode.js' import { formatDuration, formatNumber } from './utils/format.js' import type { FpsMetrics } from './utils/fpsTracker.js' import { getCanonicalName } from './utils/model/model.js' @@ -393,11 +392,6 @@ export function addToTotalSessionCost( ) } - const attrs = - isFastModeEnabled() && usage.speed === 'fast' - ? { model, speed: 'fast' } - : { model } - let totalCost = cost for (const advisorUsage of getAdvisorUsage(usage)) { const advisorCost = calculateUSDCost(advisorUsage.model, advisorUsage) diff --git a/src/entrypoints/init.ts b/src/entrypoints/init.ts index 73f63c2f9..67c36dfcb 100644 --- a/src/entrypoints/init.ts +++ b/src/entrypoints/init.ts @@ -13,7 +13,6 @@ import { import { initializeRemoteManagedSettingsLoadingPromise, isEligibleForRemoteManagedSettings, - waitForRemoteManagedSettingsToLoad, } from '../services/remoteManagedSettings/index.js' import { preconnectAnthropicApi } from '../utils/apiPreconnect.js' import { applyExtraCACertsFromConfig } from '../utils/caCertsConfig.js' @@ -24,14 +23,13 @@ import { detectCurrentRepository } from '../utils/detectRepository.js' import { logForDiagnosticsNoPII } from '../utils/diagLogs.js' import { initJetBrainsDetection } from '../utils/envDynamic.js' import { isEnvTruthy } from '../utils/envUtils.js' -import { ConfigParseError, errorMessage } from '../utils/errors.js' +import { ConfigParseError } from '../utils/errors.js' // showInvalidConfigDialog is dynamically imported in the error path to avoid loading React at init import { gracefulShutdownSync, setupGracefulShutdown, } from '../utils/gracefulShutdown.js' import { - applyConfigEnvironmentVariables, applySafeConfigEnvironmentVariables, } from '../utils/managedEnv.js' import { configureGlobalMTLS } from '../utils/mtls.js' diff --git a/src/hooks/fileSuggestions.test.ts b/src/hooks/fileSuggestions.test.ts index df2dfb8f5..ecc34739c 100644 --- a/src/hooks/fileSuggestions.test.ts +++ b/src/hooks/fileSuggestions.test.ts @@ -94,39 +94,6 @@ function restoreFileSuggestionsDependencyMocks(): void { } } -function createIgnoreModuleMock() { - return { - default: () => { - const patterns: string[] = [] - const api = { - add(input: string) { - patterns.push( - ...input - .split(/\r?\n/) - .map(line => line.trim()) - .filter(line => line.length > 0 && !line.startsWith('#')), - ) - return api - }, - ignores(filePath: string) { - const normalized = filePath.replaceAll('\\', '/') - if (normalized.split('/').includes('..')) { - throw new Error('path should be a `path.relative()`d string') - } - return patterns.some(pattern => { - const normalizedPattern = pattern.replaceAll('\\', '/') - if (normalizedPattern.endsWith('/')) { - return normalized.startsWith(normalizedPattern) - } - return normalized === normalizedPattern - }) - }, - } - return api - }, - } -} - function isGitCommand(command: string): boolean { const basename = path.basename(command).toLowerCase() return basename === 'git.exe' || basename === 'git' diff --git a/src/hooks/toolPermission/PermissionContext.ts b/src/hooks/toolPermission/PermissionContext.ts index d631d6bd0..db6533646 100644 --- a/src/hooks/toolPermission/PermissionContext.ts +++ b/src/hooks/toolPermission/PermissionContext.ts @@ -45,7 +45,6 @@ import { supportsPersistence, } from '../../utils/permissions/PermissionUpdate.js' import { - applyPermissionUpdateToLiveContext, applyPermissionUpdatesToLiveContext, getPermissionModeChangeRequestDecision, } from '../../utils/permissions/permissionSetup.js' diff --git a/src/hooks/useCanUseTool.tsx b/src/hooks/useCanUseTool.tsx index 564118923..eab49e6a3 100644 --- a/src/hooks/useCanUseTool.tsx +++ b/src/hooks/useCanUseTool.tsx @@ -17,7 +17,6 @@ import { AbortError } from '../utils/errors.js'; import { logError } from '../utils/log.js'; import type { PermissionDecision } from '../utils/permissions/PermissionResult.js'; import { hasPermissionsToUseTool } from '../utils/permissions/permissions.js'; -import { jsonStringify } from '../utils/slowOperations.js'; import { handleCoordinatorPermission } from './toolPermission/handlers/coordinatorHandler.js'; import { handleInteractivePermission } from './toolPermission/handlers/interactiveHandler.js'; import { handleSwarmWorkerPermission } from './toolPermission/handlers/swarmWorkerHandler.js'; diff --git a/src/integrations/registry.test.ts b/src/integrations/registry.test.ts index 87156d6e7..b076d1986 100644 --- a/src/integrations/registry.test.ts +++ b/src/integrations/registry.test.ts @@ -5,7 +5,6 @@ import { ensureIntegrationsLoaded } from './index.js' import { _clearRegistryForTesting, getAllAnthropicProxies, - getAllBrands, getAllGateways, getAllModels, getAllVendors, diff --git a/src/screens/REPL.tsx b/src/screens/REPL.tsx index 280d4b959..388c403cc 100644 --- a/src/screens/REPL.tsx +++ b/src/screens/REPL.tsx @@ -42,7 +42,7 @@ import { QueryLifecycleOperationTracker, formatQueryLifecycleAbortSignalReason, import { claimBackgroundTurnBudget, canRestoreDeferredMaxTurnsCap, computeDeferredMaxTurnsCapForBackgroundHandoff, createForegroundTurnBudgetHandoff, getReplMaxTurnsWarning, releaseForegroundTurnBudget, resolveReplMaxTurnsForSession, shouldShowReplMaxTurnsUnlimitedWarning, shouldContinueBackgroundAfterForegroundQuery, waitForForegroundTurnBudgetSettlement, type ForegroundTurnBudgetHandoff } from './replMaxTurns.js'; import { createCombinedAbortSignal } from '../utils/combinedAbortSignal.js'; import { isEnvTruthy } from '../utils/envUtils.js'; -import { formatTokens, truncateToWidth } from '../utils/format.js'; +import { formatTokens } from '../utils/format.js'; import { consumeEarlyInput } from '../utils/earlyInput.js'; import { setMemberActive } from '../utils/swarm/teamHelpers.js'; import { isSwarmWorker, generateSandboxRequestId, sendSandboxPermissionRequestViaMailbox, sendSandboxPermissionResponseViaMailbox } from '../utils/swarm/permissionSync.js'; diff --git a/src/screens/replMaxTurnsProp.test.ts b/src/screens/replMaxTurnsProp.test.ts index 5ae0baea8..fa6b11453 100644 --- a/src/screens/replMaxTurnsProp.test.ts +++ b/src/screens/replMaxTurnsProp.test.ts @@ -1,7 +1,6 @@ import { afterEach, beforeEach, describe, expect, spyOn, test } from 'bun:test' import { Command as CommanderCommand, - InvalidArgumentError, Option, } from '@commander-js/extra-typings' import { diff --git a/src/services/api/errors.ts b/src/services/api/errors.ts index c18b04ab0..a866ce4aa 100644 --- a/src/services/api/errors.ts +++ b/src/services/api/errors.ts @@ -32,7 +32,6 @@ import { import { getModelStrings } from 'src/utils/model/modelStrings.js' import { getAPIProvider, - isFirstPartyAnthropicBaseUrl, isFirstPartyAnthropicProvider, } from 'src/utils/model/providers.js' import { getIsNonInteractiveSession } from '../../bootstrap/state.js' diff --git a/src/services/api/openaiShim.test.ts b/src/services/api/openaiShim.test.ts index 5185ad051..a5a84217f 100644 --- a/src/services/api/openaiShim.test.ts +++ b/src/services/api/openaiShim.test.ts @@ -1,4 +1,3 @@ -import { APIError } from '@anthropic-ai/sdk' import { afterEach, beforeEach, expect, mock, test } from 'bun:test' import { getEventListeners } from 'node:events' import { acquireSharedMutationLock, releaseSharedMutationLock } from '../../test/sharedMutationLock.js' diff --git a/src/services/tools/toolExecution.ts b/src/services/tools/toolExecution.ts index 467625c7a..05446274b 100644 --- a/src/services/tools/toolExecution.ts +++ b/src/services/tools/toolExecution.ts @@ -23,10 +23,6 @@ import { getReplayIndexBuilder, getStatsStore, } from '../../bootstrap/state.js' -import { - buildCodeEditToolAttributes, - isCodeEditingTool, -} from '../../hooks/toolPermission/permissionLogging.js' import type { CanUseToolFn } from '../../hooks/useCanUseTool.js' import { findToolByName, diff --git a/src/services/wiki/conventions.test.ts b/src/services/wiki/conventions.test.ts index 6b9271b41..9dfbc324b 100644 --- a/src/services/wiki/conventions.test.ts +++ b/src/services/wiki/conventions.test.ts @@ -1,5 +1,5 @@ import { afterEach, expect, test } from 'bun:test' -import { mkdtemp, mkdir, rm, writeFile } from 'fs/promises' +import { mkdtemp, rm, writeFile } from 'fs/promises' import { tmpdir } from 'os' import { join } from 'path' import { scanProjectConventions } from './conventions.js' diff --git a/src/tools/BashTool/bashPermissions.ts b/src/tools/BashTool/bashPermissions.ts index 06dd0093b..ef5330c37 100644 --- a/src/tools/BashTool/bashPermissions.ts +++ b/src/tools/BashTool/bashPermissions.ts @@ -61,7 +61,6 @@ import { } from '../../utils/permissions/shellRuleMatching.js' import { getPlatform } from '../../utils/platform.js' import { SandboxManager } from '../../utils/sandbox/sandbox-adapter.js' -import { jsonStringify } from '../../utils/slowOperations.js' import { windowsPathToPosixPath } from '../../utils/windowsPaths.js' import { BashTool } from './BashTool.js' import { diff --git a/src/utils/analyzeContext.ts b/src/utils/analyzeContext.ts index a89a2a9c1..a43386471 100644 --- a/src/utils/analyzeContext.ts +++ b/src/utils/analyzeContext.ts @@ -11,7 +11,6 @@ import { getSystemContext } from '../context.js' import { getFeatureValue_CACHED_MAY_BE_STALE } from '../services/analytics/growthbook.js' import { getAutoCompactThreshold, - getEffectiveContextWindowSize, isAutoCompactEnabled, MANUAL_COMPACT_BUFFER_TOKENS, } from '../services/compact/autoCompact.js' diff --git a/src/utils/cronJitterConfig.ts b/src/utils/cronJitterConfig.ts index 56f430775..b2d7fe9cb 100644 --- a/src/utils/cronJitterConfig.ts +++ b/src/utils/cronJitterConfig.ts @@ -16,13 +16,6 @@ import { } from './cronTasks.js' import { lazySchema } from './lazySchema.js' -// How often to re-fetch tengu_kairos_cron_config from GrowthBook. Short because -// this is an incident lever — when we push a config change to shed :00 load, -// we want the fleet to converge within a minute, not on the next process -// restart. The underlying call is a synchronous cache read; the refresh just -// clears the memoized entry so the next read triggers a background fetch. -const JITTER_CONFIG_REFRESH_MS = 60 * 1000 - // Upper bounds here are defense-in-depth against fat-fingered GrowthBook // pushes. Like pollConfig.ts, Zod rejects the whole object on any violation // rather than partially trusting it — a config with one bad field falls back @@ -56,7 +49,7 @@ const cronJitterConfigSchema = lazySchema(() => * Read `tengu_kairos_cron_config` from GrowthBook, validate, fall back to * defaults on absent/malformed/out-of-bounds config. Called from check() * every tick via the `getJitterConfig` callback — cheap (synchronous cache - * hit). Refresh window: JITTER_CONFIG_REFRESH_MS. + * hit). * * Exported so ops runbooks can point at a single function when documenting * the lever, and so tests can spy on it without mocking GrowthBook itself. @@ -65,8 +58,7 @@ const cronJitterConfigSchema = lazySchema(() => * contexts. Daemon/SDK callers omit getJitterConfig and get defaults. */ export function getCronJitterConfig(): CronJitterConfig { - // The local growthbook shim takes no refresh-interval argument; - // JITTER_CONFIG_REFRESH_MS documents the intended cadence. + // The local growthbook shim takes no refresh-interval argument. const raw = getFeatureValue_CACHED_WITH_REFRESH( 'tengu_kairos_cron_config', DEFAULT_CRON_JITTER_CONFIG, diff --git a/src/utils/doctorDiagnostic.ts b/src/utils/doctorDiagnostic.ts index cecb279a8..e7ddb8ac7 100644 --- a/src/utils/doctorDiagnostic.ts +++ b/src/utils/doctorDiagnostic.ts @@ -374,15 +374,6 @@ async function detectMultipleInstallations(): Promise< return installations } -async function pathExists(path: string): Promise { - try { - await getFsImplementation().stat(path) - return true - } catch { - return false - } -} - export async function detectStaleProjectSettingsPaths( cwd?: string, ): Promise<{ issue: string; fix: string } | null> { diff --git a/src/utils/interruptionCorrection.test.ts b/src/utils/interruptionCorrection.test.ts index 0f306e7f8..f459e05b1 100644 --- a/src/utils/interruptionCorrection.test.ts +++ b/src/utils/interruptionCorrection.test.ts @@ -488,10 +488,7 @@ test('does not restore a consumed reminder after programmatic auto-restore cance const reminder = tracker.takeReminder()! const correction = createUserMessage({ content: 'do B instead' }) - const correctionTurn = buildInterruptionCorrectionMessageViews( - [], - [reminder, correction], - ) + buildInterruptionCorrectionMessageViews([], [reminder, correction]) const programmaticRestore = queryGuard.tryStart({ queryId: 'programmatic-restore', querySource: 'repl_main_thread', diff --git a/src/utils/permissions/filesystem.ts b/src/utils/permissions/filesystem.ts index 5989d6588..ec72b5cb7 100644 --- a/src/utils/permissions/filesystem.ts +++ b/src/utils/permissions/filesystem.ts @@ -3,7 +3,7 @@ import { randomBytes } from 'crypto' import ignore from 'ignore' import memoize from 'lodash-es/memoize.js' import { homedir, tmpdir } from 'os' -import { dirname, join, normalize, posix, sep } from 'path' +import { join, normalize, posix, sep } from 'path' import { hasAutoMemPathOverride, isAutoMemPath } from 'src/memdir/paths.js' import { isAgentMemoryPath } from 'src/tools/AgentTool/agentMemory.js' import { diff --git a/src/utils/permissions/permissions.ts b/src/utils/permissions/permissions.ts index 0b9190e3b..0720c4fd8 100644 --- a/src/utils/permissions/permissions.ts +++ b/src/utils/permissions/permissions.ts @@ -136,8 +136,6 @@ import { formatActionForClassifier, } from './yoloClassifier.js' -const CLASSIFIER_FAIL_CLOSED_REFRESH_MS = 30 * 60 * 1000 // 30 minutes - const PERMISSION_RULE_SOURCES = [ ...SETTING_SOURCES, 'cliArg', @@ -926,8 +924,7 @@ const hasPermissionsToUseToolWithModeHandling: CanUseToolFn = async ( // the tengu_iron_gate_closed gate. if (classifierResult.unavailable) { if ( - // The local growthbook shim takes no refresh-interval argument; - // CLASSIFIER_FAIL_CLOSED_REFRESH_MS documents the intended cadence. + // The local growthbook shim takes no refresh-interval argument. getFeatureValue_CACHED_WITH_REFRESH('tengu_iron_gate_closed', true) ) { logForDebugging( diff --git a/src/utils/promptShellExecution.ts b/src/utils/promptShellExecution.ts index cd6ca478c..0bb7d4603 100644 --- a/src/utils/promptShellExecution.ts +++ b/src/utils/promptShellExecution.ts @@ -2,7 +2,7 @@ import { randomUUID } from 'crypto' import type { Tool, ToolUseContext } from '../Tool.js' import { BashTool } from '../tools/BashTool/BashTool.js' import { logForDebugging } from './debug.js' -import { errorMessage, MalformedCommandError, ShellError } from './errors.js' +import { errorMessage, MalformedCommandError } from './errors.js' import type { FrontmatterShell } from './frontmatterParser.js' import { createAssistantMessage } from './messages.js' import { hasPermissionsToUseTool } from './permissions/permissions.js' diff --git a/src/utils/sessionStorage.atomicReplace.test.ts b/src/utils/sessionStorage.atomicReplace.test.ts index 751a6f4ad..73ce05fae 100644 --- a/src/utils/sessionStorage.atomicReplace.test.ts +++ b/src/utils/sessionStorage.atomicReplace.test.ts @@ -42,7 +42,6 @@ import { buildConversationChain, flushSessionStorage, getAgentTranscriptPath, - getProjectDir, getTranscriptPathForSession, hydrateFromCCRv2InternalEvents, hydrateRemoteSession, diff --git a/tests/sdk/generated-types.test.ts b/tests/sdk/generated-types.test.ts index 24617136a..60277f255 100644 --- a/tests/sdk/generated-types.test.ts +++ b/tests/sdk/generated-types.test.ts @@ -11,7 +11,6 @@ import { SDKCompactBoundaryMessageSchema, SDKMessageSchema, SDKUserMessageSchema, - SDKResultMessageSchema, SDKResultSuccessSchema, SDKResultErrorSchema, SDKSessionInfoSchema, @@ -22,10 +21,8 @@ import { ModelUsageSchema, ModelInfoSchema, FastModeStateSchema, - HookInputSchema, ExitReasonSchema, } from '../../src/entrypoints/sdk/coreSchemas.js' -import { z } from 'zod/v4' const repoRoot = fileURLToPath(new URL('../..', import.meta.url)) const generatedTypesPath = fileURLToPath(