refactor(cleanup-05): remove flat approval/status fields from SessionSnapshot
This commit is contained in:
@@ -35,20 +35,8 @@ class SessionEventBridge(
|
||||
?.map { ApprovalDto(requestId = it.id.value, tier = it.tier.name) }
|
||||
?: emptyList()
|
||||
|
||||
val pendingRequest = approvalState?.requests?.values
|
||||
?.firstOrNull { req -> approvalState.decisions.values.none { it.requestId == req.id } }
|
||||
|
||||
send(ServerMessage.SessionSnapshot(
|
||||
sessionId = sessionId,
|
||||
workflowId = orchState.workflowId,
|
||||
status = orchState.status.name,
|
||||
currentStageId = orchState.currentStageId?.value,
|
||||
pauseReason = orchState.pauseReason,
|
||||
pendingApproval = orchState.pendingApproval,
|
||||
approvalRequestId = pendingRequest?.id?.value,
|
||||
approvalTier = pendingRequest?.tier?.name,
|
||||
approvalToolName = pendingRequest?.toolName,
|
||||
approvalPreview = pendingRequest?.preview,
|
||||
state = SessionStateDto(
|
||||
status = orchState.status.name,
|
||||
currentStageId = orchState.currentStageId?.value,
|
||||
|
||||
@@ -76,15 +76,6 @@ sealed interface ServerMessage {
|
||||
@SerialName("session_snapshot")
|
||||
data class SessionSnapshot(
|
||||
val sessionId: SessionId,
|
||||
val workflowId: String,
|
||||
val status: String,
|
||||
val currentStageId: String?,
|
||||
val pauseReason: String?,
|
||||
val pendingApproval: Boolean,
|
||||
val approvalRequestId: String?,
|
||||
val approvalTier: String?,
|
||||
val approvalToolName: String?,
|
||||
val approvalPreview: String?,
|
||||
val state: SessionStateDto,
|
||||
val pendingApprovals: List<ApprovalDto>,
|
||||
val lastSequence: Long,
|
||||
|
||||
-9
@@ -39,15 +39,6 @@ class ServerMessageSerializationTest {
|
||||
fun `SessionSnapshot encodes lastSequence and lastSessionSequence`() {
|
||||
val msg = ServerMessage.SessionSnapshot(
|
||||
sessionId = SessionId("sess-1"),
|
||||
workflowId = "wf-1",
|
||||
status = "running",
|
||||
currentStageId = "stage-1",
|
||||
pauseReason = null,
|
||||
pendingApproval = false,
|
||||
approvalRequestId = null,
|
||||
approvalTier = null,
|
||||
approvalToolName = null,
|
||||
approvalPreview = null,
|
||||
state = SessionStateDto(
|
||||
status = "running",
|
||||
currentStageId = "stage-1",
|
||||
|
||||
Reference in New Issue
Block a user