feat: fence command acceptance by session

This commit is contained in:
2026-09-06 09:13:23 +00:00
parent ac18ec49e7
commit 69a7e01f9d
4 changed files with 113 additions and 0 deletions
+12
View File
@@ -229,6 +229,18 @@ func (server *AgentServer) serveConnection(parent context.Context, connection *w
server.close(connection, websocket.StatusPolicyViolation, "invalid client capacity")
return
}
continue
}
if acknowledgement := envelope.GetCommandAccepted(); acknowledgement != nil {
issue, parseErr := domain.ParseUUIDv7(acknowledgement.GetIssueUuid())
if parseErr != nil {
server.close(connection, websocket.StatusPolicyViolation, "invalid command acceptance")
return
}
if _, acceptErr := server.Store.RecordCommandAcceptance(sessionContext, issue, hello.GetClientId(), registration.Generation, acknowledgement.GetCommandRevision(), acknowledgement.GetAccepted(), server.now()); acceptErr != nil {
server.close(connection, websocket.StatusPolicyViolation, "invalid command acceptance")
return
}
}
}
}