Something went wrong: [SyntaxError] Unexpected token
Before opening, please confirm:
- [x] I have searched for duplicate or closed issues
Operating System
macOS 26.4.1
Kiro Version
0.12.333
Bug Description
I keep getting this error in my session.
Something went wrong: [SyntaxError] Unexpected token '<', "<!--# rR3W"... is not valid JSON Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object. (Conversation ID: b40140c5-b42f-4bd9-b662-7804a518b3ce)
Steps to Reproduce
- Open Kiro and any project.
- Enter a task to perform, it works for a while and then this error appears.
- Open a new session and ask to continue. works for a while and then this error appears.
- After a while of repeating steps 2 and 3, there comes a point the agent responds only this error rendering Kiro unusable.
I tried upgrading to latest from Kiro downloads, still the same error. Reverted to my earlier version to no avail. There have been many such reported earlier, but almost all issues have been closed claiming this is a "transient server issue" but this doesn't look transient to me. Please fix this error at the earliest, my tokens and time are getting burnt without getting much done.
Expected Behavior
Kiro should work as normal without this error.
Conversation ID
b40140c5-b42f-4bd9-b662-7804a518b3ce
Additional Context
π€ Potential Duplicate Detected
This issue appears to be similar to:
What happens next?
- β° This issue will be automatically closed in 3 days
- π·οΈ If this is not a duplicate, you can prevent automatic closure by adding a comment or reacting with π to this message.
- π¬ Comment on the original issue if you have additional information
Why is this marked as duplicate? Both issues report unexpected errors during Kiro sessions that render the IDE unusable, with similar patterns of the error appearing after working for a while and persisting across new sessions. Issue #7568 also involves an unexpected error while processing input on macOS with a similar Kiro version range.
No, itβs not a duplicate, as it relates to a different error than mine.
My error is
Something went wrong: [SyntaxError] Unexpected token '<', "<!--# rR3W"... is not valid JSON Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object. (Conversation ID: b40140c5-b42f-4bd9-b662-7804a518b3ce)
How is it similar to the error in the ticket you have considered?
An unexpected error occurred while processing your input.
So I don't agree. Please unmark this as a duplicate.
Thank you for your feedback! π
The duplicate label has been removed and this issue has been sent back for maintainer review.
A maintainer will review this issue shortly.
Reproducing on Kiro CLI 2.20.1 (kas `2.20.1-eb9b2abβ¦`), so this is not fixed by the 1.0.x releases suggested on the related #9166.
In my case the is not valid JSON failure comes from the spec sub-intent detection path. From ~/.kiro/logs/*/kiro.log:
[SpecSubIntentDetection] LLM classification failed
SyntaxError: Unexpected token 'Y', "You're rig"... is not valid JSON
at JSON.parse (<anonymous>)
at Rhr.detectLLMIntent (β¦/@kiro/agent/dist/server/acp-server.js)
at xfi._executeTasksWithRetry β xfi.tick β mur._runLoop
The tell: the token it fails on ("You're rigβ¦", "Ha β fair.", "I didn't rβ¦") is a plain natural-language reply, not JSON. So at least one variant of this is not a server-side HTML error page β it is detectLLMIntent calling JSON.parse() directly on a classification response the model did not format as JSON, with no guard. It fires inside the spec task _runLoop, so during spec execution it recurs every turn.
Notably the log line already carries isParseError:true, so the parse is known-fallible β it just is not caught before it disrupts the turn.
Suggested fix: detectLLMIntent should treat a non-JSON classification response as a soft failure (default/skip the intent) rather than throwing an unhandled SyntaxError into the execution loop.
Happy to share conversation IDs if useful.
Thanks for raising this. This error surfaces when the response can't be parsed as JSON, which can happen in a couple of different ways. One scenario is the backend returning an error page instead of JSON (typically a transient server-side issue). Another, as noted in the comments here, is the spec sub-intent detection path getting back plain text from the model instead of a structured JSON response. We're tracking this as a bug to investigate further.
Could you let us know if this happens on every prompt or only in certain conditions (for example, when working on a spec, or after a long session)? That'll help narrow down which path is triggering it.
The fix for this is now released. The agent now detects when the backend returns a non-JSON response (an HTML error page) and surfaces a readable, retry-oriented message instead of the raw SyntaxError and SDK deserialization hint.
This shipped in:
- kiro-cli v2.29.0
- Kiro desktop 1.3.0 (extension 1.1.382)
Please update and let us know if you still see the raw error on a current build. Thanks again for the detailed report and logs.