Skip to content

gateway_metrics_read still rejects a string "measures"; the v3.0.0 fix was reverted by a merge #440

Description

@leggetter

The v3.0.0 release notes claim this was fixed. It was not — the fix landed and was then reverted by a merge conflict resolution, and both v3.0.0 and v3.0.1 ship the broken version.

Reproduce

Against a live project, via hookdeck gateway mcp:

{"name":"gateway_metrics_read","arguments":{"action":"events","measures":"count","granularity":"1d","start":"...","end":"..."}}
measures is required (e.g. ["count"], ["successful_count", "failed_count"])

Same for the comma-separated form, "measures": "count,failed_count". Only ["count"] works.

Cause

pkg/gateway/mcp/tool_metrics.go:109 reads the argument with in.StringSlice("measures"), which returns nil for anything that is not a JSON array (pkg/mcpcore/input.go:172). The value is dropped, len(measures) == 0, and the caller is told the argument is missing for an argument they supplied.

mcpcore.StringList (pkg/mcpcore/input.go:242) exists precisely for this and accepts both forms. tool_metrics.go is the only tool on this surface still using StringSlice — for measures and for dimensions. Every other tool uses StringList.

How it regressed

  • 7dae336 (2026-08-21) fixed it, switching both measures and dimensions to mcpcore.StringList, with a comment describing this exact failure.
  • b0b5710 (2026-09-22), "Merge branch main (v2.6.0) into release/v3.0.0", reintroduced in.StringSlice("measures"). The conflict was resolved in favour of the pre-fix side.

git log -S does not show the reintroduction, because it skips merge commits by default — --full-history -m is needed to see it. That is worth knowing: a fix reverted inside a merge resolution is invisible to the usual history search.

Fix

Restore 7dae336: use mcpcore.StringList(in, "measures") and mcpcore.StringList(in, "dimensions").

Add a test that passes measures as a string, not an array. The existing tests in tool_metrics_schema_test.go and tool_metrics_filters_test.go all pass []any{"count"}, so they pass against both the fixed and the reverted code — which is why the revert went unnoticed through a beta and two GA releases.

Release-note correction

The v3.0.0 note claims "measures": "count" now works. It does not, and the note should be corrected.

Impact

Models routinely send a scalar where an array is declared; that is the whole reason StringList exists. The failure is the "filter that does not filter" shape the release made a point of closing: an argument the caller supplied is silently dropped, and the error names it as missing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions