You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Code Quality] refactor: introduce shared FlexibleID type for JSON-RPC/log id fields duplicated across pkg/cli #48890
Four independent locations in pkg/cli reinvent the same "JSON id may be a string or a number" pattern using bare any fields, each requiring its own ad hoc type-switch/normalization logic:
pkg/cli/gateway_logs_types.go:148,159 -- rpcRequestPayload.ID any, rpcResponsePayload.ID any (JSON-RPC 2.0 id)
pkg/cli/mcp_tools_privileged.go:299-300 -- logsArgs.RunID any, RunIDOrURL any
pkg/cli/logs_models.go:323-324 -- WorkflowRunInfo.RunID any, RunNumber any
Each field's ambiguity is individually justified (JSON-RPC spec, GitHub API id formats), but the pattern is duplicated four times with no shared normalization helper.
Suggested Changes
Introduce a single shared type, e.g. type FlexibleID any (or a small wrapper struct) plus one String() normalizer function in a shared location (e.g. pkg/types).
Replace the four independent ad hoc implementations with the shared type/helper.
Files Affected
pkg/cli/gateway_logs_types.go (lines 148, 159)
pkg/cli/mcp_tools_privileged.go (lines 299-300)
pkg/cli/logs_models.go (lines 323-324)
Success Criteria
A single shared FlexibleID-style type/helper exists and is used by all four call sites
Existing type-switch/normalization logic replaced by the shared helper
Activity
github-actions commentedon Jul 30, 2026
This issue was automatically closed because it expired on 2026-07-30T13:24:28.547Z.
github-actions commentedon Jul 30, 2026
This issue was automatically closed because it expired on 2026-07-30T13:24:28.547Z.
github-actions commentedon Jul 30, 2026
This issue was automatically closed because it expired on 2026-07-30T13:24:28.547Z.