feat: add empty client spool reconciliation

This commit is contained in:
2026-09-06 07:03:08 +00:00
parent bcb31a7f4e
commit fb778ce3e2
5 changed files with 74 additions and 0 deletions
+16
View File
@@ -184,6 +184,22 @@ func (server *AgentServer) serveConnection(parent context.Context, connection *w
server.close(connection, websocket.StatusPolicyViolation, ErrStaleSession.Error())
return
}
if snapshot := envelope.GetReconcileSnapshot(); snapshot != nil {
// A retained command requires the command-store reconciliation phase,
// which is deliberately not substituted with a no-op result.
if len(snapshot.GetRetainedCommands()) != 0 {
server.close(connection, websocket.StatusPolicyViolation, "reconciliation for retained commands is unavailable")
return
}
encoded, err := proto.Marshal(&rvboxv1.AgentEnvelope{
SessionId: encodedSessionID, SessionGeneration: registration.Generation,
Payload: &rvboxv1.AgentEnvelope_ReconcileResult{ReconcileResult: &rvboxv1.ReconcileResult{}},
})
if err != nil || queue.EnqueueControl(Frame{Kind: FrameControl, Payload: encoded}) != nil {
server.close(connection, websocket.StatusInternalError, "could not queue reconciliation result")
return
}
}
}
}