github / github/copilot-sdk

How to receive the session.shutdown event?

Đang mở
#490 4 bình luận 2 reaction 2 người được giao Được @SteveSandersonMS nhận Xem trên GitHub
question sdk/nodejs triaged
Ngôn ngữ chính
Java
Star
10.5k
Fork
1.5k
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
128

Mô tả

I'm trying to access `totalPremiumRequests` and other data from the `session.shutdown` event but never see it fire. I log every event type from `session.on()` and get `assistant.usage`, `session.idle`, etc but never `session.shutdown`.

My sessions are long-lived and reused, so `destroy()` isn't called during normal use. On process exit I call `client.stop()` (which calls `destroy()` internally) but still nothing shows up. Looking at the [source](https://github.com/github/copilot-sdk/blob/5016587a62652f3d184b3c6958dfc63359921aa8/nodejs/src/session.ts#L517), it looks like `destroy()` clears all event handlers right after the RPC resolves, which might be before the shutdown notification arrives.

What's the intended way to get this data?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.