From 8d0356e3725b193c24953f425057eb5f25f357ae Mon Sep 17 00:00:00 2001 From: Tasnim Kabir Sadik Date: Sat, 11 Apr 2026 23:54:23 +0600 Subject: [PATCH] fix: stop overwriting agent gRPC errors with CodeInternal Removed the `connect.NewError(connect.CodeInternal, ...)` wrapper in the Server's MakeDir proxy handler. Previously, this wrapper was catching specific agent errors (like CodeAlreadyExists) and casting them into generic Code 13 (Internal) errors, stripping the gRPC metadata. This change allows the control-plane to act as a transparent pipeline, ensuring the API gateway can properly interpret and route specific filesystem failures. --- internal/hostagent/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/hostagent/server.go b/internal/hostagent/server.go index 0a86cf6..fad0d40 100644 --- a/internal/hostagent/server.go +++ b/internal/hostagent/server.go @@ -290,7 +290,7 @@ func (s *Server) MakeDir( resp, err := client.MakeDir(ctx, msg.Path) if err != nil { - return nil, connect.NewError(connect.CodeInternal, fmt.Errorf("make dir: %w", err)) + return nil, fmt.Errorf("make dir: %w", err) } return connect.NewResponse(&pb.MakeDirResponse{