fix: remove unreachable internal-only branches (#2440)

This commit is contained in:
JATMN
2026-10-27 06:52:17 -07:00
committed by GitHub
parent 51f50e99b0
commit 94ebcff640
4 changed files with 4 additions and 84 deletions
+2 -35
View File
@@ -95,7 +95,6 @@ const DEEP_SEARCH_MAX_MESSAGES = 2000;
const DEEP_SEARCH_CROP_SIZE = 1000;
const DEEP_SEARCH_MAX_TEXT_LENGTH = 50000; // Cap searchable text per session
const FUSE_THRESHOLD = 0.3;
const DATE_TIE_THRESHOLD_MS = 60 * 1000; // 1 minute - use relevance as tie-breaker within this window
const SNIPPET_CONTEXT_CHARS = 50; // Characters to show before/after match
type Snippet = {
@@ -549,15 +548,8 @@ export function LogSelector(t0: LogSelectorProps) {
let t26;
if ($[46] !== debouncedDeepSearchQuery) {
t25 = () => {
if (true || !debouncedDeepSearchQuery || true) {
setDeepSearchResults(null);
setIsSearching(false);
return;
}
const timeoutId_0 = setTimeout(_temp5, 0, null, debouncedDeepSearchQuery, setDeepSearchResults, setIsSearching);
return () => {
clearTimeout(timeoutId_0);
};
setDeepSearchResults(null);
setIsSearching(false);
};
t26 = [debouncedDeepSearchQuery, null, false];
$[46] = debouncedDeepSearchQuery;
@@ -1529,31 +1521,6 @@ function _temp7(r_0: DeepSearchResult): LogOption {
function _temp6(log_6: LogOption): string | undefined {
return log_6.messages[0]?.uuid;
}
function _temp5(fuseIndex_0, debouncedDeepSearchQuery_0, setDeepSearchResults_0, setIsSearching_0) {
const results = fuseIndex_0.search(debouncedDeepSearchQuery_0);
results.sort(_temp3);
setDeepSearchResults_0({
results: results.map(_temp4),
query: debouncedDeepSearchQuery_0
});
setIsSearching_0(false);
}
function _temp4(r) {
return {
log: r.item.log,
score: r.score,
searchableText: r.item.searchableText
};
}
function _temp3(a, b) {
const aTime = new Date(a.item.log.modified).getTime();
const bTime = new Date(b.item.log.modified).getTime();
const timeDiff = bTime - aTime;
if (Math.abs(timeDiff) > DATE_TIE_THRESHOLD_MS) {
return timeDiff;
}
return (a.score ?? 1) - (b.score ?? 1);
}
function _temp2(log_1: LogOption): boolean {
const currentSessionId = getSessionId();
const logSessionId = getSessionIdFromLog(log_1);
@@ -13,7 +13,6 @@ import { launchUltraplan } from '../../../commands/ultraplan.js';
import type { KeyboardEvent } from '../../../ink/events/keyboard-event.js';
import { Box, Text } from '../../../ink.js';
import type { AppState } from '../../../state/AppStateStore.js';
import { AGENT_TOOL_NAME } from '../../../tools/AgentTool/constants.js';
import { EXIT_PLAN_MODE_V2_TOOL_NAME } from '../../../tools/ExitPlanModeTool/constants.js';
import type { AllowedPrompt } from '../../../tools/ExitPlanModeTool/ExitPlanModeV2Tool.js';
import { TEAM_CREATE_TOOL_NAME } from '../../../tools/TeamCreateTool/constants.js';
@@ -467,10 +466,6 @@ export function ExitPlanModePermissionRequest({
});
// Set initial message - REPL will handle context clear and fresh query
// Add verification instruction if the feature is enabled
// Dead code elimination: CLAUDE_CODE_VERIFY_PLAN='false' in external builds, so === 'true' check allows Bun to eliminate the string
const verificationInstruction = undefined === 'true' ? `\n\nIMPORTANT: When you have finished implementing the plan, you MUST call the "VerifyPlanExecution" tool directly (NOT the ${AGENT_TOOL_NAME} tool or an agent) to trigger background verification.` : '';
// Capture the transcript path before context is cleared (session ID will be regenerated)
const transcriptPath = getTranscriptPath();
const transcriptHint = `\n\nIf you need specific details from before exiting plan mode (like exact code snippets, error messages, or content you generated), read the full transcript at: ${transcriptPath}`;
@@ -481,7 +476,7 @@ export function ExitPlanModePermissionRequest({
initialMessage: {
message: {
...createUserMessage({
content: `Implement the following plan:\n\n${currentPlan}${verificationInstruction}${transcriptHint}${teamHint}${feedbackSuffix}`
content: `Implement the following plan:\n\n${currentPlan}${transcriptHint}${teamHint}${feedbackSuffix}`
}),
planContent: currentPlan
},
+1 -25
View File
@@ -6,10 +6,8 @@
import { APIError } from '@anthropic-ai/sdk'
import {
applyMockHeaders,
checkMockFastModeRateLimit,
getMockHeaderless429Message,
getMockHeaders,
isMockFastModeRateLimitScenario,
shouldProcessMockLimits,
} from './mockRateLimits.js'
@@ -41,7 +39,7 @@ export function shouldProcessRateLimits(isSubscriber: boolean): boolean {
*/
export function checkMockRateLimitError(
currentModel: string,
isFastModeActive?: boolean,
_isFastModeActive?: boolean,
): APIError | null {
if (!shouldProcessMockLimits()) {
return null
@@ -86,28 +84,6 @@ export function checkMockRateLimitError(
return null
}
// Check for mock fast mode rate limits (handles expiry, countdown, etc.)
if (isMockFastModeRateLimitScenario()) {
const fastModeHeaders = checkMockFastModeRateLimit(isFastModeActive)
if (fastModeHeaders === null) {
return null
}
// Create a mock 429 error with the fast mode headers
const error = new APIError(
429,
{ error: { type: 'rate_limit_error', message: 'Rate limit exceeded' } },
'Rate limit exceeded',
// eslint-disable-next-line eslint-plugin-n/no-unsupported-features/node-builtins
new globalThis.Headers(
Object.entries(fastModeHeaders).filter(([_, v]) => v !== undefined) as [
string,
string,
][],
),
)
return error
}
const shouldThrow429 =
status === 'rejected' && (!overageStatus || overageStatus === 'rejected')
-18
View File
@@ -9,7 +9,6 @@ import {
resolveActiveRouteIdFromEnv,
} from '../integrations/routeMetadata.js'
import { getCanonicalName } from './model/model.js'
import { getModelCapability } from './model/modelCapabilities.js'
import { resolveAntModel } from './model/antModels.js'
import { getActiveProviderProfile } from './providerProfiles.js'
@@ -268,17 +267,6 @@ export function getContextWindowForModel(
return OPENAI_FALLBACK_CONTEXT_WINDOW
}
const cap = getModelCapability(model)
if (cap?.max_input_tokens && cap.max_input_tokens >= 100_000) {
if (
cap.max_input_tokens > MODEL_CONTEXT_WINDOW_DEFAULT &&
is1mContextDisabled()
) {
return MODEL_CONTEXT_WINDOW_DEFAULT
}
return cap.max_input_tokens
}
if (betas?.includes(CONTEXT_1M_BETA_HEADER) && modelSupports1M(model)) {
return 1_000_000
}
@@ -427,12 +415,6 @@ export function getModelMaxOutputTokens(model: string): {
upperLimit = MAX_OUTPUT_TOKENS_UPPER_LIMIT
}
const cap = getModelCapability(model)
if (cap?.max_tokens && cap.max_tokens >= 4_096) {
upperLimit = cap.max_tokens
defaultTokens = Math.min(defaultTokens, upperLimit)
}
return { default: defaultTokens, upperLimit }
}