feat: execute durable client commands through supervisor

This commit is contained in:
2026-09-06 12:18:15 +00:00
parent 3f84d3b2f1
commit 56b15c7f4f
41 changed files with 4272 additions and 66 deletions
+22 -11
View File
@@ -77,16 +77,27 @@ func Reconcile(ctx context.Context, transport Transport, session Session, snapsh
if err := transport.Write(ctx, encoded); err != nil {
return nil, err
}
received, err := transport.Read(ctx)
if err != nil {
return nil, err
for {
received, err := transport.Read(ctx)
if err != nil {
return nil, err
}
result, err := agentproto.DecodeEnvelope(received, limits, rvboxv1.Platform_PLATFORM_WINDOWS)
if err != nil {
return nil, fmt.Errorf("decode reconciliation response: %w", err)
}
if result.GetSessionId() != session.ID || result.GetSessionGeneration() != session.Generation {
return nil, ErrProtocolHandshake
}
if result.GetReconcileRequest() != nil {
// The request may have been queued before the client's snapshot write
// reached the server. The snapshot is already on the wire; consume the
// advisory target frame and continue waiting for the durable result.
continue
}
if result.GetReconcileResult() == nil {
return nil, ErrProtocolHandshake
}
return proto.Clone(result.GetReconcileResult()).(*rvboxv1.ReconcileResult), nil
}
result, err := agentproto.DecodeEnvelope(received, limits, rvboxv1.Platform_PLATFORM_WINDOWS)
if err != nil {
return nil, fmt.Errorf("decode ReconcileResult: %w", err)
}
if result.GetSessionId() != session.ID || result.GetSessionGeneration() != session.Generation || result.GetReconcileResult() == nil {
return nil, ErrProtocolHandshake
}
return proto.Clone(result.GetReconcileResult()).(*rvboxv1.ReconcileResult), nil
}