fix: enable encodeDefaults so message persistence actually works

kotlinx.serialization defaults to not encoding properties with default
values. SaveMessage.kind = "chat" was never sent, causing the backend's
sanitizeSaveableMessage() to reject every save with 400. This also
broke title generation since it was gated behind a successful save.
This commit is contained in:
Bruno Deanoz 2026-06-21 13:43:24 +02:00
parent 9759d478a7
commit 203316b1c3

View file

@ -138,7 +138,7 @@ object KaizenApi {
.readTimeout(0, TimeUnit.SECONDS) // streaming chat — never time out a healthy stream .readTimeout(0, TimeUnit.SECONDS) // streaming chat — never time out a healthy stream
.build() .build()
private val json = Json { ignoreUnknownKeys = true } private val json = Json { ignoreUnknownKeys = true; encodeDefaults = true }
private val jsonMedia = "application/json".toMediaType() private val jsonMedia = "application/json".toMediaType()
/** POST /api/v1/auth/token — exchange email+password for a `kzn_` bearer token. */ /** POST /api/v1/auth/token — exchange email+password for a `kzn_` bearer token. */