From 2e3b8e599c521f82f4759902714e8ae1393ee9ce Mon Sep 17 00:00:00 2001 From: kami Date: Mon, 25 May 2026 19:56:07 +0400 Subject: [PATCH] =?UTF-8?q?chore(approval):=20TODO=20markers=20for=20overl?= =?UTF-8?q?ay=20UX=20and=20requestId=E2=86=92sessionId=20lookup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two follow-ups for the approval refactor: - InputReducer STEER input mode hardcodes APPROVE; needs the future approve/reject overlay UX to let the user pick. - GlobalStreamHandler derives scopeSessionId from requestId as a placeholder; needs a real requestId → sessionId lookup once exposed. --- .../kotlin/com/correx/apps/server/ws/GlobalStreamHandler.kt | 3 +++ .../main/kotlin/com/correx/apps/tui/reducer/InputReducer.kt | 2 ++ 2 files changed, 5 insertions(+) diff --git a/apps/server/src/main/kotlin/com/correx/apps/server/ws/GlobalStreamHandler.kt b/apps/server/src/main/kotlin/com/correx/apps/server/ws/GlobalStreamHandler.kt index 55d5f212..5b188938 100644 --- a/apps/server/src/main/kotlin/com/correx/apps/server/ws/GlobalStreamHandler.kt +++ b/apps/server/src/main/kotlin/com/correx/apps/server/ws/GlobalStreamHandler.kt @@ -134,6 +134,9 @@ class GlobalStreamHandler(private val module: ServerModule) { msg: ClientMessage.ApprovalResponse, sendFrame: suspend (ServerMessage) -> Unit, ) { + // TODO: scopeSessionId is a placeholder derived from requestId — the global socket + // is not bound to a single session. Switch to a proper requestId → sessionId lookup + // (via ApprovalCoordinator or the approval repository) once that mapping is exposed. val scopeSessionId: SessionId = TypeId(msg.requestId.value) module.approvalCoordinator.handleResponse(msg, scopeSessionId)?.let { sendFrame(it) } } diff --git a/apps/tui/src/main/kotlin/com/correx/apps/tui/reducer/InputReducer.kt b/apps/tui/src/main/kotlin/com/correx/apps/tui/reducer/InputReducer.kt index 4a14b340..f8116a15 100644 --- a/apps/tui/src/main/kotlin/com/correx/apps/tui/reducer/InputReducer.kt +++ b/apps/tui/src/main/kotlin/com/correx/apps/tui/reducer/InputReducer.kt @@ -69,6 +69,8 @@ object InputReducer { Effect.SendWs( ClientMessage.ApprovalResponse( requestId = ApprovalRequestId(active.requestId), + // TODO: hardcoded APPROVE until the approve/reject overlay UX lands; + // then the user picks the decision explicitly alongside the note. decision = ApprovalDecision.APPROVE, steeringNote = text, ),