Bug Report
Summary
Resuming a session via session.resume fails with a JSON-RPC error when the saved session file has attachments: null. The SDK now expects attachments to be an array, but previously saved sessions store null.
Error
JSON-RPC Error -32603: Request session.resume failed with message:
Session file is corrupted (line 24: data.attachments: Expected array, received null)
Steps to Reproduce
- Create a session (with SDK version that stores
attachments: null in the session file)
- Save the session ID
- On a new run, call
session.resume with the saved session ID
- Observe the error above
Expected Behavior
Either:
- The SDK accepts
null as a valid (empty) value for attachments during resume (backwards-compatible), or
- A more graceful error that allows the caller to detect the corruption and fall back to starting a new session
Actual Behavior
Resume throws a hard JSON-RPC -32603 error that cannot be easily distinguished from other fatal errors, forcing the caller to start a fresh session without a clean signal.
Environment
github-copilot-sdk version: 0.1.32
- Python:
3.12.3
- OS: Linux (Ubuntu 24.04)
Suggested Fix
Treat null as equivalent to [] for the attachments field during session deserialization, to maintain backwards compatibility with older session files.
Bug Report
Summary
Resuming a session via
session.resumefails with a JSON-RPC error when the saved session file hasattachments: null. The SDK now expectsattachmentsto be an array, but previously saved sessions storenull.Error
Steps to Reproduce
attachments: nullin the session file)session.resumewith the saved session IDExpected Behavior
Either:
nullas a valid (empty) value forattachmentsduring resume (backwards-compatible), orActual Behavior
Resume throws a hard JSON-RPC
-32603error that cannot be easily distinguished from other fatal errors, forcing the caller to start a fresh session without a clean signal.Environment
github-copilot-sdkversion:0.1.323.12.3Suggested Fix
Treat
nullas equivalent to[]for theattachmentsfield during session deserialization, to maintain backwards compatibility with older session files.