feat: adopt side-questions via prompt.btw and /btw command in Chat (fixes #1015) (#1026)

Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
M57andM57 authored and GitHub committed 2026-08-31 15:54:09 +03:00
1 parent b5c4ba50cd
commit 53c8eca714
12 files changed
+487 -2

No files matched your search

@@ -163,6 +163,13 @@ object EventParser {
WsEvent.ReviewSummary(text, sessionId)
}
"btw.complete" -> {
val taskId = payload?.get("task_id") as? String ?: ""
val question = payload?.get("question") as? String ?: ""
val text = (payload?.get("text") as? String)?.trim() ?: ""
WsEvent.BtwComplete(taskId, question, text, sessionId)
}
"session.updated" -> {
WsEvent.SessionUpdated(payload)
}
@@ -150,6 +150,18 @@ sealed class WsEvent {
val sessionId: String? = null,
) : WsEvent()
/**
* Context-aware side-question completion event (issue #1015).
* Emitted when `prompt.btw` completes answering a side question.
* Payload: `{ task_id: "...", question: "...", text: "..." }`
*/
data class BtwComplete(
val taskId: String = "",
val question: String = "",
val text: String = "",
val sessionId: String? = null,
) : WsEvent()
// ── Status ───────────────────────────────────────────────────────────
data class StatusUpdate(
@@ -25,6 +25,7 @@ object WsMethods {
// ── Interaction ───────────────────────────────────────────────────────
const val PROMPT_SUBMIT = "prompt.submit"
const val PROMPT_BTW = "prompt.btw"
const val CLARIFY_RESPOND = "clarify.respond"
const val APPROVAL_RESPOND = "approval.respond"
const val SUDO_RESPOND = "sudo.respond"