Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

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

未關閉 適合新手
#2,759 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
65/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
python
領域
api, backend

研究方向

查看 copilot/generated/session_events.py 中產生的會話事件,特別是 ShutdownType 枚舉。將允許的值與運行時發送的 'destroy' 字串進行比較。檢查協議定義或運行時原始碼,以確定哪一方是正確的。編寫一個測試來驗證修復是否處理了新值。

由索引模型根據 Issue 內容生成。

描述

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"?

主要語言
Java
星號
10.5k
分支
1.5k
平均合併
1 天 5 小時
30 天內合併 PR
108

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

github/copilot-sdk 的其他 Issue

查看 github/copilot-sdk 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。