First, session_id expires inconsistently. A week-old conversation's session_id still works, but sometimes a 2-day-old one is already gone.
Second, submitting a query with an expired or invalid session_id (e.g., "foobar", "helloworld") causes the Claude Agent SDK to terminate with exit code 1, displaying "Unknown Error." This error is identifiable—it should be labeled as an "invalid session_id error." Unfortunately, since the SDK is just a wrapper around the Claude Code CLI rather than a standalone Python package, I cannot fix this issue.
I think this needs stable session management and a validation API to check the session_id before submitting queries.
First, session_id expires inconsistently. A week-old conversation's session_id still works, but sometimes a 2-day-old one is already gone.
Second, submitting a query with an expired or invalid session_id (e.g., "foobar", "helloworld") causes the Claude Agent SDK to terminate with exit code 1, displaying "Unknown Error." This error is identifiable—it should be labeled as an "invalid session_id error." Unfortunately, since the SDK is just a wrapper around the Claude Code CLI rather than a standalone Python package, I cannot fix this issue.
I think this needs stable session management and a validation API to check the session_id before submitting queries.