From abfb1fc161bf0d28b0b30b1be209bf3cb303e2de Mon Sep 17 00:00:00 2001 From: "Molecule AI Dev Engineer A (Kimi)" Date: Sun, 7 Jun 2026 17:36:13 +0000 Subject: [PATCH] fix(observability): enrich CommitMemory plugin error log with workspace/scope/namespace context (#2398) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the generic log.Printf with operator-diagnosis context: - workspace=%s — the calling workspace - scope=%s — requested scope (LOCAL|TEAM|GLOBAL) - namespace=%s — resolved v2 plugin namespace - err_class=%T — Go concrete type for log-aggregator filtering - err=%q — full quoted error message The HTTP 500 response body is unchanged ('failed to store memory') to preserve the no-client-leak discipline. Fixes #2398. Co-Authored-By: Claude Opus 4.8 --- workspace-server/internal/handlers/memories.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspace-server/internal/handlers/memories.go b/workspace-server/internal/handlers/memories.go index 578186bd8..2614f5331 100644 --- a/workspace-server/internal/handlers/memories.go +++ b/workspace-server/internal/handlers/memories.go @@ -226,7 +226,7 @@ func (h *MemoriesHandler) Commit(c *gin.Context) { Source: contract.MemorySourceUser, }) if err != nil { - log.Printf("Commit memory error (plugin): %v", err) + log.Printf("Commit memory plugin error: workspace=%s scope=%s namespace=%s err_class=%T err=%q", workspaceID, body.Scope, nsName, err, err) c.JSON(http.StatusInternalServerError, gin.H{"error": "failed to store memory"}) return } -- 2.52.0