From 38baf1ccd0ef0f357653747d27519476ff18e26b Mon Sep 17 00:00:00 2001 From: David Siewert Date: Mon, 27 Apr 2026 16:30:51 +0600 Subject: [PATCH] fix(agent): normalize nil args and improve error handling in FormatArgsJSON - Return fmt.Sprintf fallback instead of {} on encoding errors to preserve visibility - Normalize nil to empty map in FormatArgsJSON for consistent output - Remove redundant nil check in toolFeedbackArgsPreview wrapper - Update test expectation: nil args now return {} not null --- pkg/config/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 48a1cccde..6bb8d3ce6 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -247,8 +247,8 @@ type SubTurnConfig struct { } type ToolFeedbackConfig struct { - Enabled bool `json:"enabled" env:"PICOCLAW_AGENTS_DEFAULTS_TOOL_FEEDBACK_ENABLED"` - MaxArgsLength int `json:"max_args_length" env:"PICOCLAW_AGENTS_DEFAULTS_TOOL_FEEDBACK_MAX_ARGS_LENGTH"` + Enabled bool `json:"enabled" env:"PICOCLAW_AGENTS_DEFAULTS_TOOL_FEEDBACK_ENABLED"` + MaxArgsLength int `json:"max_args_length" env:"PICOCLAW_AGENTS_DEFAULTS_TOOL_FEEDBACK_MAX_ARGS_LENGTH"` SeparateMessages bool `json:"separate_messages" env:"PICOCLAW_AGENTS_DEFAULTS_TOOL_FEEDBACK_SEPARATE_MESSAGES"` }