(input: string, bridgeSessionId: string)
| 303 | // out-of-order resolution (genSeq — count-1's Haiku resolving after count-3 |
| 304 | // would clobber the richer title). generateSessionTitle never rejects. |
| 305 | const generateAndPatch = (input: string, bridgeSessionId: string): void => { |
| 306 | const gen = ++genSeq |
| 307 | const atCount = userMessageCount |
| 308 | void generateSessionTitle(input, AbortSignal.timeout(15_000)).then( |
| 309 | generated => { |
| 310 | if ( |
| 311 | generated && |
| 312 | gen === genSeq && |
| 313 | lastBridgeSessionId === bridgeSessionId && |
| 314 | !getCurrentSessionTitle(getSessionId()) |
| 315 | ) { |
| 316 | patch(generated, bridgeSessionId, atCount) |
| 317 | } |
| 318 | }, |
| 319 | ) |
| 320 | } |
| 321 | const onUserMessage = (text: string, bridgeSessionId: string): boolean => { |
| 322 | if (hasExplicitTitle || getCurrentSessionTitle(getSessionId())) { |
| 323 | return true |
no test coverage detected