Skip to content

fix(dotnet): recover from dropped session idle events#2016

Draft
hydraxman wants to merge 1 commit into
github:mainfrom
hydraxman:fix/dotnet-session-idle-reliability
Draft

fix(dotnet): recover from dropped session idle events#2016
hydraxman wants to merge 1 commit into
github:mainfrom
hydraxman:fix/dotnet-session-idle-reliability

Conversation

@hydraxman

Copy link
Copy Markdown

Summary

  • make .NET SendAndWaitAsync recover when the ephemeral session.idle notification is dropped
  • use the runtime's task-drain and activity RPCs as the authoritative fallback
  • flush the SDK's FIFO event-dispatch queue and reject stale inactive snapshots when new events or work appear during confirmation

Reproduction

  • Before: the dropped-idle unit reproducer times out after receiving the assistant response and assistant.turn_end
  • After: the same reproducer completes after the runtime reports no active work and preceding user handlers have drained
  • A second deterministic reproducer reactivates runtime work during the final dispatch barrier and verifies the stale inactive snapshot is not used

Tests

  • dotnet test test/GitHub.Copilot.SDK.Test.csproj -f net8.0 --no-restore --filter 'FullyQualifiedName~SendAndWaitAsync_Completes_When_SessionIdle_Notification_Is_Dropped|FullyQualifiedName~SendAndWaitAsync_DroppedIdle_Fallback_Flushes_Preceding_Event_Handlers|FullyQualifiedName~SendAndWaitAsync_DroppedIdle_Fallback_Rechecks_Activity_After_Final_Barrier|FullyQualifiedName~SendAndWaitReliabilityE2ETests'
  • dotnet test test/GitHub.Copilot.SDK.Test.csproj -f net8.0 --no-restore — 676 passed, 3 skipped
  • COPILOT_SDK_DEFAULT_CONNECTION=inprocess dotnet test test/GitHub.Copilot.SDK.Test.csproj -f net8.0 --no-restore --filter 'FullyQualifiedName~SendAndWaitReliabilityE2ETests'
  • dotnet build src/GitHub.Copilot.SDK.csproj --no-restore — 0 warnings, 0 errors
  • dotnet format --verify-no-changes --no-restore

Fixes #2008

@hydraxman
hydraxman force-pushed the fix/dotnet-session-idle-reliability branch from 11e23c4 to 57c96dd Compare July 17, 2026 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET: runtime logs forwarding session.idle, but SDK callback never delivers it

1 participant