Skip to content

Conversation

@ivancernja
Copy link

Fixes #7946

When cancel() rejects the prompt callback, the stream closes without writing anything. SDK then crashes parsing empty body.

This catches the rejection and writes null instead.

Couldn't reproduce locally but the fix seems correct based on the code flow.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found two potentially related PRs:

  1. PR fix(tui): handle JSON parse error on double-escape abort #7959: fix(tui): handle JSON parse error on double-escape abort

  2. PR fix: add error handling to RPC system to prevent crashes on session abort #7939: fix: add error handling to RPC system to prevent crashes on session abort

These PRs appear to be addressing the same or very similar issue—handling crashes that occur when prompt/session cancellation happens and results in empty or unparseable data. PR #8025 should be reviewed against these to ensure consistency or to determine if they're duplicate efforts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash on double-escape abort: JSON parse error from prompt response

1 participant