MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / onStateChange

Function onStateChange

src/cli/print.ts:4172–4187  ·  view source on GitHub ↗
(state, detail)

Source from the content-addressed store, hash-verified

4170 }
4171 },
4172 onStateChange(state, detail) {
4173 if (state === 'failed') {
4174 bridgeFailureDetail = detail
4175 }
4176 logForDebugging(
4177 `[bridge:sdk] State change: ${state}${detail ? ` — ${detail}` : ''}`,
4178 )
4179 output.enqueue({
4180 type: 'system' as StdoutMessage['type'],
4181 subtype: 'bridge_state' as string,
4182 state,
4183 detail,
4184 uuid: randomUUID(),
4185 session_id: getSessionId(),
4186 } as StdoutMessage)
4187 },
4188 initialMessages:
4189 mutableMessages.length > 0 ? mutableMessages : undefined,
4190 })

Callers 9

RecentDenialsTabFunction · 0.85
initEnvLessBridgeCoreFunction · 0.85
wireTransportCallbacksFunction · 0.85
recoverFromAuthFailureFunction · 0.85
initBridgeCoreFunction · 0.85
wireTransportFunction · 0.85
startWorkPollLoopFunction · 0.85
initReplBridgeFunction · 0.85

Calls 3

getSessionIdFunction · 0.85
logForDebuggingFunction · 0.50
enqueueMethod · 0.45

Tested by

no test coverage detected