MCPcopy Index your code
hub / github.com/codeaashu/claude-code / abortSpeculation

Function abortSpeculation

src/services/PromptSuggestion/speculation.ts:802–833  ·  view source on GitHub ↗
(setAppState: SetAppState)

Source from the content-addressed store, hash-verified

800}
801
802export function abortSpeculation(setAppState: SetAppState): void {
803 setAppState(prev => {
804 if (prev.speculation.status !== 'active') return prev
805
806 const {
807 id,
808 abort,
809 startTime,
810 boundary,
811 suggestionLength,
812 messagesRef,
813 isPipelined,
814 } = prev.speculation
815
816 logForDebugging(`[Speculation] Aborting ${id}`)
817
818 logSpeculation(
819 id,
820 'aborted',
821 startTime,
822 suggestionLength,
823 messagesRef.current,
824 boundary,
825 { abort_reason: 'user_typed', is_pipelined: isPipelined },
826 )
827
828 abort()
829 safeRemoveOverlay(getOverlayPath(id))
830
831 return { ...prev, speculation: IDLE_SPECULATION_STATE }
832 })
833}
834
835export async function handleSpeculationAccept(
836 speculationState: ActiveSpeculationState,

Callers 5

PromptInputFunction · 0.85
startSpeculationFunction · 0.85
enqueueShellNotificationFunction · 0.85
enqueueAgentNotificationFunction · 0.85
usePromptSuggestionFunction · 0.85

Calls 5

logForDebuggingFunction · 0.85
logSpeculationFunction · 0.85
safeRemoveOverlayFunction · 0.85
getOverlayPathFunction · 0.85
abortFunction · 0.50

Tested by

no test coverage detected