fix: remove next 40 unused local findings (batch 4) (#2456)

This commit is contained in:
JATMN
2026-10-27 10:06:54 -07:00
committed by GitHub
parent 31274c145a
commit 1cead2c906
35 changed files with 14 additions and 157 deletions
-1
View File
@@ -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,
+2 -3
View File
@@ -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);
-1
View File
@@ -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,
-15
View File
@@ -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, number>): string {
return Object.entries(breakdown)
.map(([tool, count]) => `${count} ${tool}`)
.join(', ')
}
async function findLogBySessionId(sessionId: UUID): Promise<LogOption | undefined> {
const logs = await loadSameRepoMessageLogs(await getWorktreePaths(getOriginalCwd()));
return logs.find(log => getSessionIdFromLog(log) === sessionId);
+1 -1
View File
@@ -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<RestoreOption>[] {
-1
View File
@@ -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';
@@ -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';
+1 -1
View File
@@ -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,
-1
View File
@@ -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';
-1
View File
@@ -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';
@@ -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
@@ -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 = <Box minWidth={2}><Text dimColor={true}>{TEARDROP_ASTERISK}</Text></Box>;
$[0] = t2;
} else {
t2 = $[0];
}
let t3;
if ($[1] !== message.content) {
t3 = <Text dimColor={true}>{message.content}</Text>;
$[1] = message.content;
$[2] = t3;
} else {
t3 = $[2];
}
let t4;
if ($[3] !== bg || $[4] !== t1 || $[5] !== t3) {
t4 = <Box flexDirection="row" marginTop={t1} backgroundColor={bg} width="100%">{t2}{t3}</Box>;
$[3] = bg;
$[4] = t1;
$[5] = t3;
$[6] = t4;
} else {
t4 = $[6];
}
return t4;
}
function BridgeStatusMessage(t0) {
const $ = _c(13);
const {
-1
View File
@@ -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';
-6
View File
@@ -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)
+1 -3
View File
@@ -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'
-33
View File
@@ -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'
@@ -45,7 +45,6 @@ import {
supportsPersistence,
} from '../../utils/permissions/PermissionUpdate.js'
import {
applyPermissionUpdateToLiveContext,
applyPermissionUpdatesToLiveContext,
getPermissionModeChangeRequestDecision,
} from '../../utils/permissions/permissionSetup.js'
-1
View File
@@ -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';
-1
View File
@@ -5,7 +5,6 @@ import { ensureIntegrationsLoaded } from './index.js'
import {
_clearRegistryForTesting,
getAllAnthropicProxies,
getAllBrands,
getAllGateways,
getAllModels,
getAllVendors,
+1 -1
View File
@@ -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';
-1
View File
@@ -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 {
-1
View File
@@ -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'
-1
View File
@@ -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'
-4
View File
@@ -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,
+1 -1
View File
@@ -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'
-1
View File
@@ -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 {
-1
View File
@@ -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'
+2 -10
View File
@@ -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<unknown>(
'tengu_kairos_cron_config',
DEFAULT_CRON_JITTER_CONFIG,
-9
View File
@@ -374,15 +374,6 @@ async function detectMultipleInstallations(): Promise<
return installations
}
async function pathExists(path: string): Promise<boolean> {
try {
await getFsImplementation().stat(path)
return true
} catch {
return false
}
}
export async function detectStaleProjectSettingsPaths(
cwd?: string,
): Promise<{ issue: string; fix: string } | null> {
+1 -4
View File
@@ -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',
+1 -1
View File
@@ -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 {
+1 -4
View File
@@ -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(
+1 -1
View File
@@ -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'
@@ -42,7 +42,6 @@ import {
buildConversationChain,
flushSessionStorage,
getAgentTranscriptPath,
getProjectDir,
getTranscriptPathForSession,
hydrateFromCCRv2InternalEvents,
hydrateRemoteSession,
-3
View File
@@ -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(