How to receive the session.shutdown event?

Open
#490 4 comments 2 reactions 2 assignees View on GitHub

@SteveSandersonMS is already working on this.

Since Feb 18, 2026.

Assessment

This issue has not been assessed yet.

Description

question sdk/nodejs triaged

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, 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?

Dominant language
Java
Stars
10.5k
Forks
1.5k
Avg merge
1d 12h
Merged PRs (30d)
133

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/copilot-sdk

All issues in github/copilot-sdk

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.