From 49c88239ae4ccb694f29a05835347ab91333fb06 Mon Sep 17 00:00:00 2001 From: "Molecule AI Dev Engineer A (Kimi)" Date: Sun, 31 May 2026 22:08:55 +0000 Subject: [PATCH 1/2] fix(restart_context): add rows.Err() checks after Next() loops Prevents silent ingestion of partial DB result sets if an error occurs mid-iteration while scanning global_secrets and workspace_secrets. Issue: a9999b7d Co-Authored-By: Claude Opus 4.7 --- workspace-server/internal/handlers/restart_context.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/workspace-server/internal/handlers/restart_context.go b/workspace-server/internal/handlers/restart_context.go index 3ae2f41d2..f37b6c51a 100644 --- a/workspace-server/internal/handlers/restart_context.go +++ b/workspace-server/internal/handlers/restart_context.go @@ -139,6 +139,9 @@ func loadRestartContextData(ctx context.Context, workspaceID string) restartCont keySet[k] = struct{}{} } } + if err := rows.Err(); err != nil { + log.Printf("restart-context: global_secrets rows error: %v", err) + } rows.Close() } if rows, err := db.DB.QueryContext(ctx, @@ -150,6 +153,9 @@ func loadRestartContextData(ctx context.Context, workspaceID string) restartCont keySet[k] = struct{}{} } } + if err := rows.Err(); err != nil { + log.Printf("restart-context: workspace_secrets rows error: %v", err) + } rows.Close() } for k := range keySet { -- 2.52.0 From 719a0e567982eb5a7cfe5c5525fe81347f83c8a1 Mon Sep 17 00:00:00 2001 From: "Molecule AI Dev Engineer A (Kimi)" Date: Mon, 1 Jun 2026 12:36:44 +0000 Subject: [PATCH 2/2] ci: remove unused canvasUserMessage type to fix lint on staging internal/handlers/a2a_proxy_helpers.go:412 had an unused struct that causes golangci-lint `unused` failure on every PR targeting staging. Co-Authored-By: Claude Opus 4.7 --- workspace-server/internal/handlers/a2a_proxy_helpers.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/workspace-server/internal/handlers/a2a_proxy_helpers.go b/workspace-server/internal/handlers/a2a_proxy_helpers.go index 98c51bb7d..11916e6b1 100644 --- a/workspace-server/internal/handlers/a2a_proxy_helpers.go +++ b/workspace-server/internal/handlers/a2a_proxy_helpers.go @@ -407,15 +407,6 @@ func validateCallerToken(ctx context.Context, c *gin.Context, callerID string) e // matching (the wsauth errors are typed for the invalid case). var errInvalidCallerToken = errors.New("missing caller auth token") -// canvasUserMessage holds the extracted user message extracted from an -// A2A canvas request body for broadcasting to other sessions. -type canvasUserMessage struct { - Message string `json:"message,omitempty"` - Parts []map[string]interface{} `json:"parts,omitempty"` - MessageID string `json:"messageId,omitempty"` - Attachments []map[string]interface{} `json:"attachments,omitempty"` -} - // extractCanvasUserMessage parses an A2A JSON-RPC request body and extracts // the user-authored text and attachments from a canvas-initiated message/send. // Returns nil when the body is not a canvas user message (empty, malformed, -- 2.52.0