fix(session): fix title generation for new sessions with client-provided UUID#63
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fix title generation logic in
Recorderfor new sessions where a UUID is provided by the client (e.g., web UI) before the session file exists on disk.Problem
Previously,
SetUUID()unconditionally setr.resuming = true, which causedRecordUser()to skip title generation entirely. This meant new sessions created via the web interface (which provides a UUID upfront) would never get an auto-generated title.Additionally, the title generation guard
r.file == nil && !r.resumingwas fragile — it relied on file creation state rather than explicitly tracking whether a title had already been generated.Changes
SetUUID(): Only markresuming = trueif the session file already exists on disk. For brand-new sessions with a client-provided UUID, the recorder is left in "new" mode so the first user message still triggers title generation.hasTitlefield: New boolean field that explicitly tracks whether a title has been generated, replacing the implicitr.file == nilcheck inRecordUser().RecordUser(): Updated to use!r.hasTitle && !r.resuminginstead ofr.file == nil && !r.resumingfor theneedsTitlecheck. Setsr.hasTitle = trueafter generating the title.Testing