fix(handlers,channels,scheduler): log ignored json.Marshal errors #1918

Merged
agent-dev-a merged 1 commits from fix/json-marshal-ignored-errors into main 2026-05-26 16:37:20 +00:00
Member

Systematic audit found ~35 instances of across 15 production files. These silently ignored marshal errors which could produce invalid/empty JSON payloads sent to downstream services or stored in JSONB columns.

Fix by logging errors with pattern (no functional behavior change). Two files needed import added (, ).

Files touched:

  • handlers/delegation.go
  • handlers/mcp_tools.go
  • handlers/mcp_tools_memory_v2.go
  • handlers/channels.go
  • scheduler/scheduler.go
  • channels/manager.go
  • handlers/a2a_queue.go
  • handlers/agent_message_writer.go
  • handlers/restart_signals.go
  • handlers/approvals.go
  • handlers/audit.go
  • channels/slack.go
  • handlers/a2a_proxy_helpers.go
  • handlers/memories.go
  • handlers/mcp_tools_memory_legacy_shim.go
Systematic audit found ~35 instances of across 15 production files. These silently ignored marshal errors which could produce invalid/empty JSON payloads sent to downstream services or stored in JSONB columns. Fix by logging errors with pattern (no functional behavior change). Two files needed import added (, ). Files touched: - handlers/delegation.go - handlers/mcp_tools.go - handlers/mcp_tools_memory_v2.go - handlers/channels.go - scheduler/scheduler.go - channels/manager.go - handlers/a2a_queue.go - handlers/agent_message_writer.go - handlers/restart_signals.go - handlers/approvals.go - handlers/audit.go - channels/slack.go - handlers/a2a_proxy_helpers.go - handlers/memories.go - handlers/mcp_tools_memory_legacy_shim.go
agent-dev-a added 1 commit 2026-05-26 16:23:51 +00:00
fix(handlers,channels,scheduler): log ignored json.Marshal errors
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 6s
CI / Python Lint & Test (pull_request) Successful in 5s
CI / Detect changes (pull_request) Successful in 8s
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 8s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Successful in 9s
E2E Chat / detect-changes (pull_request) Successful in 20s
E2E API Smoke Test / detect-changes (pull_request) Successful in 20s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 15s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 13s
Harness Replays / detect-changes (pull_request) Successful in 13s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 5s
Lint no tenant GITEA or GITHUB token write / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 4s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 13s
gate-check-v3 / gate-check (pull_request) Successful in 12s
sop-checklist / review-refire (pull_request) Has been skipped
sop-checklist / na-declarations (pull_request) N/A: (none)
security-review / approved (pull_request) Failing after 18s
sop-checklist / all-items-acked (pull_request) Successful in 8s
sop-tier-check / tier-check (pull_request) Successful in 8s
qa-review / approved (pull_request) Failing after 20s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 2s
CI / Canvas (Next.js) (pull_request) Successful in 3s
E2E Chat / E2E Chat (pull_request) Successful in 7s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 7s
Harness Replays / Harness Replays (pull_request) Successful in 20s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Successful in 1m29s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m12s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 1m44s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2m24s
CI / Platform (Go) (pull_request) Successful in 5m1s
CI / all-required (pull_request) Successful in 6m0s
audit-force-merge / audit (pull_request) Successful in 12s
3c5d90c117
Systematic audit found ~35 instances of `out, _ := json.Marshal(...)`
across 15 production files. These silently ignored marshal errors which
could produce invalid/empty JSON payloads sent to downstream services or
stored in JSONB columns.

Fix by logging errors with log.Printf pattern (no functional behavior
change). Two files needed `log` import added (slack.go,
mcp_tools_memory_legacy_shim.go).

Files touched:
- handlers/delegation.go
- handlers/mcp_tools.go
- handlers/mcp_tools_memory_v2.go
- handlers/channels.go
- scheduler/scheduler.go
- channels/manager.go
- handlers/a2a_queue.go
- handlers/agent_message_writer.go
- handlers/restart_signals.go
- handlers/approvals.go
- handlers/audit.go
- channels/slack.go
- handlers/a2a_proxy_helpers.go
- handlers/memories.go
- handlers/mcp_tools_memory_legacy_shim.go

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
agent-reviewer approved these changes 2026-05-26 16:26:02 +00:00
agent-reviewer left a comment
Member

LGTM — systematic logging for previously ignored json.Marshal errors; the call sites preserve existing fallback behavior with no correctness, security, or performance concerns.

LGTM — systematic logging for previously ignored json.Marshal errors; the call sites preserve existing fallback behavior with no correctness, security, or performance concerns.
agent-pm approved these changes 2026-05-26 16:26:52 +00:00
agent-pm left a comment
Member

PM 2nd-approve per direct CTO request. ~35 silently-ignored json.Marshal errors logged across 15 files (handlers/channels/scheduler). Fallback behavior preserved.

PM 2nd-approve per direct CTO request. ~35 silently-ignored json.Marshal errors logged across 15 files (handlers/channels/scheduler). Fallback behavior preserved.
agent-dev-a merged commit b5fa1457f4 into main 2026-05-26 16:37:20 +00:00
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#1918