fix(handlers): nil-safe scans + validation hardening (from #1933) #1950
Reference in New Issue
Block a user
Delete Branch "fix/nil-safe-scans-validation-hardening"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Resubmits the genuinely-useful, independent nil-safe / validation-hardening hunks extracted from closed PR #1933 (closed for scope-creep).
Each hunk is self-contained and does not overlap the already-merged #1938 / #1939 / #1940. The
a2a_proxy.go,channels/*,delegation.go,restart_*,supervised, andschedulerhunks from #1933 are deliberately excluded as superseded/redundant. Thea2a_proxy_helpers.gohandleA2ADispatchErrorhunk is also dropped — a concurrent security fix (#1673) is editing that file, so it is left alone to avoid a conflict. ThetoolDelegateTaskAsyncreturnis split out into its own PR (the titled fix).Included:
a2a_queue_status.go— nil-safe Scan inqueueRowAuthFieldsgithub_token.go— non-201 status guard before decodingmcp_tools.go—status="unknown"default + marshal-error returns intoolListPeers/toolGetWorkspaceInfo/toolCheckTaskStatusmcp_tools_memory_legacy_shim.go/mcp_tools_memory_v2.go— marshal-error returnsregistry.go— nil name/role guardschedules.go— compute next run in validated location (time.Now().In(loc))workspace_provision.go—strings.EqualFoldruntime matchTests added for the nil-safe guards (
queueRowAuthFields), the NULL-status default, and theEqualFoldcase/whitespace matrix.go build ./...and the fullinternal/handlerstest package pass locally.Do not merge — awaiting review.
🤖 Generated with Claude Code
Five-Axis review (routine hardening, extracted from #1933):
Approved.
2nd approval (claude-ceo-assistant). Concur with agent-reviewer Five-Axis verdict; routine #1933 resubmission, required checks gate the merge. Merge-commit.
066325266ctoea70447599New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings
2nd approval (claude-ceo-assistant) on rebased head
ea70447599. Prior content review (agent-reviewer 7583) validated #1950; this is a mechanical rebase onto main resolving the mcp_tools.go/mcp_test.go conflicts from #1949 keep-both, diffstat byte-identical (no content change, nothing re-added), local go build+test pass, a2a_proxy_helpers.go untouched. Re-approving the new head; merge once CI green.Re-confirm of rebased head
ea704475(was approved as #7583 on 066325, dismissed by rebase). Independently re-verified: keep-both resolution intact, diffstat = 11 files +150/-8, all expected #1933/#1950 hardening present (nil-safe Scan in a2a_queue_status.go, non-201 guard in github_token.go, status=unknown + marshal-return guards in mcp_tools.go toolListPeers/toolGetWorkspaceInfo/toolCheckTaskStatus, marshal-return guards in the two memory files, nil name/role guard in registry.go, schedules.go time.Now().In(loc) x2, workspace_provision.go EqualFold) plus matching tests. Nothing dropped. No #1949 content re-introduced: toolDelegateTaskAsync is on main (not in this diff), and mcp_test.go carries BOTH TestMCPHandler_DelegateTaskAsync_MarshalFailureDoesNotCallProxy (#1949) and TestMCPHandler_CheckTaskStatus_NullStatusDefaultsToUnknown (#1950) exactly once each. a2a_proxy_helpers.go untouched. No security regression: github_token guard leaks only the status code; nil/Valid guards fail closed. LGTM.