Repository navigation
fix: show chat parse error stack in the stack trace modal - #1652
Open
SameDesu123 wants to merge 1 commit into
Open
SameDesu123 wants to merge 1 commit into
SameDesu123 wants to merge 1 commit into
Conversation
Pass an Error to alertError instead of concatenating the stack into the message string, so the stack goes to the details panel rather than the alert body. Also drop the leaked translated flag from the message.
Contributor
Author
cubicj
approved these changes
Oct 10, 2026
cubicj
left a comment
Collaborator
There was a problem hiding this comment.
I went through 1f8180c on this. On main the whole stack is folded into the one string handed to alertError, so it lands in the alert body and stackTrace stays empty, which is why the details button never shows up. With the wrapped Error the body is down to the message, the Failed to fetch hint still matches, and the original stack goes to the details panel. I ran the main and head catch blocks side by side against a few thrown values, and a thrown null, which made the main catch block throw on .message, now ends in the parse alert as well. pnpm check, pnpm test, and pnpm build are clean on this head.
Approving — thanks for the contribution!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


PR Checklist
Summary
Show the stack of a chat message parsing error in the stack trace panel of the error alert instead of in the alert body.
Related Issues
Fixes #1653
Changes
markParsinginChatBody.sveltepassedalertErrora single string that combined the message anderror.stack.alertErroronly separates the stack intostackTracewhen it receives anError, so the full stack was printed in the alert body and the "Show error details" panel never appeared.Error, copy the original stack onto it, and pass that toalertError. The stack now goes to the existing details panel, where the source map translation and copy features apply.translatedflag from the message. It showed up as a meaninglesstrue,/false,in the alert.Impact
Error while parsing chat message: <message>plus the existing submessage (for example, the network hint forFailed to fetch, which is still matched against the message).Error, only the message is shown and the details button stays hidden, same as other alerts without a stack.Additional Notes
pnpm check: 0 errorsFootnotes
Modifies the behavior of prompting, requesting, or handling responses from AI models. ↩
Over 80% of the code is AI generated. ↩