Issue with Sanity AI Assist not working, possible problem with schema validation error.

16 replies
Last updated: Nov 9, 2023
Hey y’all! The Sanity AI Assist is acting up for us. It works on some things but I generally cannot get it to work even with the simplest instructions.I tried troubleshooting it by enabling “Pause on caught exceptions” and “Pause on uncaught exceptions” in devtools; but no exceptions are being raised.

I tried upgrading to the latest version of every Sanity package we use (including AI Assist), but it does not make a difference.

It started happening this morning. Any thoughts on how I can troubleshoot this further for you guys?

Attaching a screenshot where I made a super simple instruction for one field, which doesn’t work (and I tried many different content types9
Nov 9, 2023, 9:41 AM
Just got a report from my editor about this too
Nov 9, 2023, 12:50 PM
Currently looking into it
Nov 9, 2023, 12:50 PM
It seems like sanity is complaining that the AI Document is not a valid document schema.
Nov 9, 2023, 1:03 PM
That's strange because we've been using these schemas for a while now, and AI assist used to work with them just fine.
Nov 9, 2023, 1:05 PM
Same, that schema must be generated dynamically or served remotely
Nov 9, 2023, 1:05 PM
Is it because we added a new schema that broke all the existing ones perhaps? Although a broken schema usually breaks the whole studio
Nov 9, 2023, 1:06 PM
No, we didn't make any changes at all and we have the problem too
Nov 9, 2023, 1:06 PM
I am going to open an issue on the assist repository
Nov 9, 2023, 1:09 PM
Nov 9, 2023, 1:20 PM
Nice detective work man! ❤️
Nov 9, 2023, 1:37 PM
Appreciate it, although i still have no clue what's actually causing this, or if the schema validation error is even related. Don't have time to look into where that JSON parsing error is coming from, but i'm assuming it's an API thing.
Nov 9, 2023, 1:39 PM
Yeah we haven’t touched our dependency versions so I’m inclined to agree
Nov 9, 2023, 1:39 PM
⚠️ ⚠️ ⚠️ Sanity AI Assist is broken for at least 2 workspaces, github issue has been filed
Nov 9, 2023, 1:40 PM
We haven't deployed our studio in weeks, so yeah definitely points to an API thing.
Nov 9, 2023, 1:41 PM
Thank you both. We’ve implemented a fix for a breaking change by a third-party API used by AI Assist.
Nov 9, 2023, 5:05 PM

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?