From ac549a25eb57c8cf84b487103aa34643022032fc Mon Sep 17 00:00:00 2001 From: Molecule AI Core-BE Date: Tue, 12 May 2026 14:02:43 +0000 Subject: [PATCH] debug(handlers): log when agentServer receives request to diagnose hang Co-Authored-By: Claude Opus 4.7 --- .../handlers/delegation_executor_integration_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/workspace-server/internal/handlers/delegation_executor_integration_test.go b/workspace-server/internal/handlers/delegation_executor_integration_test.go index 038715b6..ef1672c8 100644 --- a/workspace-server/internal/handlers/delegation_executor_integration_test.go +++ b/workspace-server/internal/handlers/delegation_executor_integration_test.go @@ -143,10 +143,10 @@ func readDelegationRow(t *testing.T, conn *sql.DB) (status, preview, errorDetail func agentServer(t *testing.T, statusCode int, declaredLength int, actualBody string) *httptest.Server { t.Helper() return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Drain the request body so the client's request-body writer goroutine - // can finish without a broken-pipe error. - io.Copy(io.Discard, r.Body) + handlerStart := time.Now() + n, _ := io.Copy(io.Discard, r.Body) r.Body.Close() + t.Logf("agentServer: request received after %v, body=%d bytes, sending %d", time.Since(handlerStart), n, len(actualBody)) // declaredLength exists as a parameter so callers can assert that // mismatched headers are handled correctly (the transport-level