Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Comments

Close side panel

fix: handle prompt abort to prevent JSON parse crash#8025

Open
ivancernja wants to merge 1 commit intoanomalyco:devanomalyco/opencode:devfrom
ivancernja:devivancernja/opencode:devCopy head branch name to clipboard
Open

fix: handle prompt abort to prevent JSON parse crash#8025
ivancernja wants to merge 1 commit intoanomalyco:devanomalyco/opencode:devfrom
ivancernja:devivancernja/opencode:devCopy head branch name to clipboard

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.