MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / handleAutoModeTransition

Function handleAutoModeTransition

source code/bootstrap/state.ts:1375–1401  ·  view source on GitHub ↗
(
  fromMode: string,
  toMode: string,
)

Source from the content-addressed store, hash-verified

1373}
1374
1375export function handleAutoModeTransition(
1376 fromMode: string,
1377 toMode: string,
1378): void {
1379 // Auto↔plan transitions are handled by prepareContextForPlanMode (auto may
1380 // stay active through plan if opted in) and ExitPlanMode (restores mode).
1381 // Skip both directions so this function only handles direct auto transitions.
1382 if (
1383 (fromMode === 'auto' && toMode === 'plan') ||
1384 (fromMode === 'plan' && toMode === 'auto')
1385 ) {
1386 return
1387 }
1388 const fromIsAuto = fromMode === 'auto'
1389 const toIsAuto = toMode === 'auto'
1390
1391 // If switching TO auto mode, clear any pending exit attachment
1392 // This prevents sending both auto_mode and auto_mode_exit when user toggles quickly
1393 if (toIsAuto && !fromIsAuto) {
1394 STATE.needsAutoModeExitAttachment = false
1395 }
1396
1397 // If switching out of auto mode, trigger the auto_mode_exit attachment
1398 if (fromIsAuto && !toIsAuto) {
1399 STATE.needsAutoModeExitAttachment = true
1400 }
1401}
1402
1403// LSP plugin recommendation session tracking
1404export function hasShownLspRecommendationThisSession(): boolean {

Callers 1

transitionPermissionModeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected