fix(chat): fix old session resume losing server session ID

* fix(chat): reset agent typing status when resuming old sessions

* fix(chat): fix race condition in websocket request registration

* test(chat): update mocks for new send/sendMessage onSent callback

* style(chat): use named onSent param instead of trailing lambda

* style(chat): fix import ordering for ConcurrentHashMap

* test(chat): fix remaining 2-arg verify calls for send()
This commit is contained in:
M57 authored and GitHub committed 2026-06-20 00:40:16 +03:00
1 parent 46b24593f9
commit 0fabad820d
3 files changed
+72 -35

No files matched your search

@@ -136,8 +136,10 @@ object HermesWsClient {
fun send(
method: String,
params: Map<String, Any> = emptyMap(),
onSent: ((String) -> Unit)? = null,
): String {
val id = requestId.incrementAndGet().toString()
onSent?.invoke(id)
val request = JsonRpcRequest(id = id, method = method, params = params)
val json = gson.toJson(request)
// B2 (Jun 18 2026, kanban t_8884db16): outgoing JSON contains user
@@ -152,10 +154,12 @@ object HermesWsClient {
fun sendMessage(
sessionId: String,
text: String,
onSent: ((String) -> Unit)? = null,
): String =
send(
method = WsMethods.PROMPT_SUBMIT,
params = mapOf("session_id" to sessionId, "text" to text),
onSent = onSent,
)
// ── Internal ─────────────────────────────────────────────────────────