fix: await session title generation before returning#19293
fix: await session title generation before returning#19293joaobibiano wants to merge 1 commit intoanomalyco:devfrom
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
The following comment was made by an LLM, it may be inaccurate: Based on my search results, I found one potentially related PR: Related PR:
Why it's related: |
Issue for this PR
Closes #
Type of change
What does this PR do?
New sessions generate their thread title in the background. The prompt loop could finish before that work completed, which left some sessions stuck on the default
New session - ...title even though the title model was available.This change tracks the title-generation promise inside the session loop, reuses the session abort signal, and waits for the title update before returning. It also adds a regression test that simulates a slower title model so the race stays covered.
How did you verify your code works?
bun test test/session/prompt.test.tsbun typecheckScreenshots / recordings
N/A
Checklist