feat(#125): fix clarify input pre-filling and parse/route clarify_id (#156)

* feat(#125): fix clarification input pre-filling and parse/route clarify_id

* fix(#156): fix ktlint violations in ChatViewModelTest.kt

---------

Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
M57andM57 authored and GitHub committed 2026-06-20 16:35:58 +03:00
1 parent 4544d88f8d
commit 03cfcf8504
5 files changed
+38 -7

No files matched your search

@@ -82,10 +82,11 @@ object EventParser {
"clarify.request" -> {
val text = payload?.get("text") as? String
val rawOptions = payload?.get("options")
val clarifyId = payload?.get("clarify_id") as? String ?: payload?.get("request_id") as? String
@Suppress("UNCHECKED_CAST")
val options = (rawOptions as? List<*>)?.filterIsInstance<String>()
WsEvent.ClarifyRequest(text, options)
WsEvent.ClarifyRequest(text, options, clarifyId)
}
"status.update" -> {
@@ -56,6 +56,7 @@ sealed class WsEvent {
data class ClarifyRequest(
val text: String?,
val options: List<String>?,
val clarifyId: String? = null,
) : WsEvent()
// ── Status ───────────────────────────────────────────────────────────