defineField({
name: 'simpleDocument'
type: 'document',
fields: [
{
name: 'title',
type: 'string',
},
],
readOnly: () => false
// 👆 not read-only, but AI Assist will not allow to modify this document
})
Even though the document ISN'T read-only, whatever AI instruction you try to run on any field will return Instruction failed. The document is read-only for Al Assist.
My hunch is that @sanity/assist is only checking if documentSchema.readOnly is truthy, hence accepting functions as true instead of executing it and parsing the proper read-only value.
Describe the bug
Given the schema:
Even though the document ISN'T read-only, whatever AI instruction you try to run on any field will return
Instruction failed. The document is read-only for Al Assist.
Which versions of Sanity are you using?
What operating system are you using?
MacOS, apple silicon
Which versions of Node.js / npm are you running?
10.4.0 v20.11.0
Additional context
My hunch is that
@sanity/assist
is only checking ifdocumentSchema.readOnly
is truthy, hence accepting functions astrue
instead of executing it and parsing the proper read-only value.