Skip to content
This repository was archived by the owner on May 24, 2026. It is now read-only.
This repository was archived by the owner on May 24, 2026. It is now read-only.

Investigate Copilot SDK cancellation serialization bug #319

Closed
github/copilot-sdk
#783

Description

@PureWeen

Summary

Multi-agent orchestration sessions get stuck at IsProcessing=true when cancellation tokens fire. The root cause is a bug in the Copilot SDK where StreamJsonRpc.RequestId is not included in the AOT-safe JSON serialization context.

Symptoms

  • Orchestrator sessions show Thinking... forever
  • Crash log shows NotSupportedException for RequestId serialization at StreamJsonRpc.StandardCancellationStrategy.CancelOutboundRequest
  • 180s watchdog fires, response length is 0

Root Cause

SDK Bug: When a CancellationToken fires during an SDK call, StandardCancellationStrategy tries to serialize RequestId, but the SDK's SystemTextJsonFormatter doesn't include it in the TypeInfoResolverChain. The exception is unobserved, killing the JSON-RPC reader silently.

Workaround

PR implements workaround: pass CancellationToken.None to SDK SendAsync calls. Cancellation is handled at the TCS level via ResponseCompletion.TrySetCanceled().

Action Items

  • Decide whether to file issue on github/copilot-sdk
  • Monitor for SDK fix
  • Remove workaround once fixed

SDK Versions Affected

  • Broken: 0.1.30, 0.1.32
  • Works: 0.1.26

Activity

  1. added 2 commits that reference this issue on Mar 9, 2026
    366fbe3
    3bc8ea7
  2. added a commit that references this issue on Apr 4, 2026
    2caba62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions