If you find a security vulnerability, do NOT open an issue. Email security@sanity.io instead.
Describe the bug
Sanity AI assist stopped functioning earlier today. Actions result in nothing, and we're getting "Unexpected end of JSON input" in the Sanity AI Assist Status box.
Digging deeper, the AI Document schema doesn't seem to validate and results in a console.error entry that isn't immediately obvious. Overwriting console.error to inspect the state, we see that it's the AI Document that doesn't validate (using object in type instead of document, though this isn't new, so not sure why it's complaining now):
To Reproduce
Steps to reproduce the behavior:
Login to a studio with sanity assist enabled. This happens locally as well as online on *.sanity.studio which hasn't been deployed in weeks in our case.
Schema error should already be present in the console
Run an instruction, notice that nothing happens after it finishes.
Observe the unexpected end of JSON error in the assist status box
Expected behavior
Instruction should apply the results, AI Document schema shouldn't cause a schema type error.
Screenshots
See above.
Which versions of Sanity are you using?
This happens on the newest versions:
@sanity/cli (global) 3.19.2 (up to date)
@sanity/assist 1.2.13 (up to date)
@sanity/code-input 4.1.1 (up to date)
@sanity/dashboard 3.1.5 (up to date)
@sanity/document-internationalization 2.0.2 (up to date)
@sanity/eslint-config-studio 3.0.1 (up to date)
@sanity/vision 3.19.2 (up to date)
sanity 3.19.2 (up to date)
Hey, this turned out to be caused by a recent breaking change in the third party APIs used by AI Assist.
This has now been fixed in the backend (from whence the JSON parse error came).
If you find a security vulnerability, do NOT open an issue. Email security@sanity.io instead.
Describe the bug
Sanity AI assist stopped functioning earlier today. Actions result in nothing, and we're getting "Unexpected end of JSON input" in the
Sanity AI Assist Status
box.Digging deeper, the AI Document schema doesn't seem to validate and results in a
console.error
entry that isn't immediately obvious. Overwriting console.error to inspect the state, we see that it's the AI Document that doesn't validate (usingobject
in type instead ofdocument
, though this isn't new, so not sure why it's complaining now):To Reproduce
Steps to reproduce the behavior:
Expected behavior
Instruction should apply the results, AI Document schema shouldn't cause a schema type error.
Screenshots See above.
Which versions of Sanity are you using? This happens on the newest versions:
But was initially observed on:
What operating system are you using? Windows 11 / WSL
Which versions of Node.js / npm are you running?