Enabling AI Classifier does not seem to work on v1

Issue Description

After upgrading to v1.0.0 i wanted to try out the AI classifier again.

I keep getting “Invalid value for object property” using the default settings with these changes:

  1. Set “run when” to “true”
  2. Having selected an existing model in the selection tool

Expected Behavior

AI classifier should be enabled.

Actual Behavior

Web UI does not allow saving and reports “Invalid value for object property” after the list of categories.

Stalwart Version

v1.x

Installation Method

Binary (FreeBSD)

Database Backend

RocksDB

Blob Storage

RocksDB

Search Engine

Internal

Directory Backend

Internal

I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.

on

I have searched this support forum (open and closed topics) and confirm this is not a duplicate.

on

I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

This was a bug in the schema the web UI uses for default values. When you switch the AI classifier to enabled, the form fills itself from those defaults. Some of them were stored in a format the server doesn’t accept: the example lists inside each default category (the “includes” sets) went out as plain JSON arrays, which is the “Invalid value for object property” you saw after the Categories list. “Run when” had the same kind of problem, so setting it to true yourself got you past that one.

I’ve fixed how the defaults are generated, which also covers a few other forms with the same issue, and added tests that enable the classifier from a clean form. The fix will ship in the next weekly Stalwart release. After upgrading, enabling it with the default categories and your model selected should save normally.