github / github/copilot-sdk

How to receive the session.shutdown event?

Aperta
#490 4 commenti 2 reazioni 2 assegnatari Rivendicata da @SteveSandersonMS Vedi su GitHub
question sdk/nodejs triaged
Lingua principale
Java
Stelle
10.5k
Fork
1.5k
Merge medio
1g 11h
PR unite (30g)
127

Descrizione

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?

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.