Agent host logs an error when releasing sampling interest during shutdown
Open
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
## Problem
When an agent-host session shuts down, cleanup can try to release the MCP sampling interest after the SDK session has already gone away. This produces an error during an otherwise normal shutdown.
Example:
```text
[trace] [Copilot:] Session shutdown: type=routine, apiDuration=0ms
[error] Error: Request session.eventLog.releaseInterest failed with message: Session not found for sessionId:
[Copilot:] Failed to release sampling event interest
```
The sampling interest should be released before disconnecting the SDK session. If the session has already shut down, there is nothing left to release.
Contributor guide
Assessment
This issue has not been assessed yet.