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

Function generateAndPatch

src/bridge/initReplBridge.ts:333–348  ·  view source on GitHub ↗
(input: string, bridgeSessionId: string)

Source from the content-addressed store, hash-verified

331 // out-of-order resolution (genSeq — count-1's Haiku resolving after count-3
332 // would clobber the richer title). generateSessionTitle never rejects.
333 const generateAndPatch = (input: string, bridgeSessionId: string): void => {
334 const gen = ++genSeq
335 const atCount = userMessageCount
336 void generateSessionTitle(input, AbortSignal.timeout(15_000)).then(
337 generated => {
338 if (
339 generated &&
340 gen === genSeq &&
341 lastBridgeSessionId === bridgeSessionId &&
342 !getCurrentSessionTitle(getSessionId())
343 ) {
344 patch(generated, bridgeSessionId, atCount)
345 }
346 },
347 )
348 }
349 const onUserMessage = (text: string, bridgeSessionId: string): boolean => {
350 if (hasExplicitTitle || getCurrentSessionTitle(getSessionId())) {
351 return true

Callers 1

onUserMessageFunction · 0.85

Calls 4

generateSessionTitleFunction · 0.85
getCurrentSessionTitleFunction · 0.85
getSessionIdFunction · 0.85
patchFunction · 0.85

Tested by

no test coverage detected