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
- Initiated a session, went through 2 turns
- The adapter performed cleanup using client.delete_session(session_id),
followed by client.stop().
- 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"?
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
The installed SDK's copilot/_cli_version.py pins CLI_VERSION = "1.0.85",
matching the runtime version reported during the run.
Observed behavior
followed by client.stop().
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:
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"?