Repository navigation
fix(handlers): keep root session span open across session.idle - #71
schemaitat wants to merge 1 commit into
Conversation
The opencode.session span and accumulated session totals were ended and deleted on the first session.idle event. Since a session keeps receiving turns after going idle, every subsequent turn's LLM/tool spans had no local session span to nest under and became orphaned root traces, with their token/cost contributions silently dropped from session.total_*. Keep the session span and totals alive across session.idle (only snapshotting attributes), and finalize them in a new handleSessionDeleted handler, on session.error, or on process shutdown.
|
Warning Review limit reached
More reviews will be available in 56 minutes and 11 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ 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 |
|
Hi, thanks for the comment. I will reconsider. My goal was to track, debug and analyze long lived sessions using a session explorer built on top of the OTEL traces coming from this plugin. Maybe it would be worth enabling this using an env var since it also comes with downsides. What do you think ? |
|
Created a new PR for opt-in long running sessions. See #71. |
Description
The
opencode.sessionspan and accumulated session totals were ended and deleted on the firstsession.idleevent. Since a session keeps receiving turns after going idle, every subsequent turn's LLM/tool spans had no local session span to nest under and became orphaned root traces, with their token/cost contributions silently dropped fromsession.total_*.Keeps the session span and totals alive across
session.idle(only snapshotting attributes), and finalizes them in a newhandleSessionDeletedhandler, onsession.error, or on process shutdown.Type of change
Checklist
bun run lintpasses with no errorsbun run check:jsdoc-coveragepasses with no errorsbun run typecheckpasses with no errorsbun testpasses with no errorsRelated issues
Supersedes #64 and #70 — same fix, rebased as a single commit on current
mainon a proper feature branch.Additional context
bun test— 282 pass, 0 fail.