(input: string, bridgeSessionId: string)
| 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 |
no test coverage detected