Skip to content

Python: shutdown notification rejects 'destroy' with SDK 1.0.14 / runtime 1.0.85 #2759

Description

@adrian-gavrila

Summary

After a successful two-turn conversation, deleting the session produces an
unhandled exception in the Python SDK's session notification callback:

ValueError: 'destroy' is not a valid ShutdownType

Environment

  • OS: Windows
  • Python: 3.12.14
  • github-copilot-sdk: 1.0.14
  • Runtime version reported by client.get_status(): 1.0.85
  • Protocol version: 3
  • Model: gpt-5-mini

The installed SDK's copilot/_cli_version.py pins CLI_VERSION = "1.0.85",
matching the runtime version reported during the run.

Observed behavior

  1. Initiated a session, went through 2 turns
  2. The adapter performed cleanup using client.delete_session(session_id),
    followed by client.stop().
  3. During cleanup, the SDK notification callback raised the exception below.

The conversation succeeded. I have not independently verified whether session
deletion completed despite the callback exception.

Relevant traceback

CopilotClient._connect_via_stdio..handle_notification
→ session_event_from_dict
→ SessionEvent.from_dict
→ SessionShutdownData.from_dict
→ parse_enum(ShutdownType, obj.get("shutdownType"))

ValueError: 'destroy' is not a valid ShutdownType

Offline parser reproduction

This requires no authentication or model requests:

from copilot.generated.session_events import ShutdownType, parse_enum

print([item.value for item in ShutdownType])
# ['routine', 'error']

parse_enum(ShutdownType, "destroy")
# ValueError: 'destroy' is not a valid ShutdownType

This demonstrates the parser rejection, not the full live cleanup sequence.

Expected behavior

The SDK and its pinned runtime should agree on shutdown notification values,
so normal session cleanup does not produce an unhandled callback exception.

Should the runtime emit a different shutdownType, or should the SDK accept
"destroy"?

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions