MCPcopy
hub / github.com/codeaashu/claude-code / injectModelSwitchBreadcrumbs

Function injectModelSwitchBreadcrumbs

src/cli/print.ts:1222–1247  ·  view source on GitHub ↗
(
    modelArg: string,
    resolvedModel: string,
  )

Source from the content-addressed store, hash-verified

1220 let activeUserSpecifiedModel = options.userSpecifiedModel
1221
1222 function injectModelSwitchBreadcrumbs(
1223 modelArg: string,
1224 resolvedModel: string,
1225 ): void {
1226 const breadcrumbs = createModelSwitchBreadcrumbs(
1227 modelArg,
1228 modelDisplayString(resolvedModel),
1229 )
1230 mutableMessages.push(...breadcrumbs)
1231 for (const crumb of breadcrumbs) {
1232 if (
1233 typeof crumb.message.content === 'string' &&
1234 crumb.message.content.includes(`<${LOCAL_COMMAND_STDOUT_TAG}>`)
1235 ) {
1236 output.enqueue({
1237 type: 'user',
1238 message: crumb.message,
1239 session_id: getSessionId(),
1240 parent_tool_use_id: null,
1241 uuid: crumb.uuid,
1242 timestamp: crumb.timestamp,
1243 isReplay: true,
1244 } satisfies SDKUserMessageReplay)
1245 }
1246 }
1247 }
1248
1249 // Cache SDK MCP clients to avoid reconnecting on each run
1250 let sdkClients: MCPServerConnection[] = []

Callers 1

runHeadlessStreamingFunction · 0.85

Calls 5

modelDisplayStringFunction · 0.85
getSessionIdFunction · 0.85
pushMethod · 0.45
enqueueMethod · 0.45

Tested by

no test coverage detected