Skip to content

refactor: move outlier functions to semantically correct files/packages#7394

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/refactor-semantic-function-clustering-analysis
Draft

refactor: move outlier functions to semantically correct files/packages#7394
Copilot wants to merge 2 commits into
mainfrom
copilot/refactor-semantic-function-clustering-analysis

Conversation

Copilot AI commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Four functions lived in files that didn't match their purpose. This moves each to its natural home with no logic changes.

Changes

  • strutil/json_clone.go (new) — extracts DeepCloneJSON from strutil.go; JSON deep-clone has nothing to do with string utilities
  • mcp/helpers.go (new) — extracts marshalToResponse, unmarshalParams, and callParamMethod from pagination.go; these are general-purpose MCP helpers consumed by connection_methods.go, not pagination-specific code
  • server/middleware.go — moves withResponseLogging from http_helpers.go; it's an http.Handler decorator and belongs alongside WithOTELTracing, authMiddleware, WithSDKLogging, etc.
  • mcpresult/mcpresult.go (new, replaces content_items.go + text_content.go) — consolidates two tiny single-function files into one; NormalizeContentItems and ExtractTextContent form a single logical unit

Finding 5 (AgentTagsSnapshot in mcp/connection_logging.go) is left as-is pending circular import analysis.

GitHub Advanced Security started work on behalf of lpcox June 11, 2026 22:47 View session
GitHub Advanced Security finished work on behalf of lpcox June 11, 2026 22:49
GitHub Advanced Security started work on behalf of lpcox June 11, 2026 22:53 View session
Copilot AI changed the title [WIP] Refactor JSON utility in string utility package refactor: move outlier functions to semantically correct files/packages Jun 11, 2026
Copilot finished work on behalf of lpcox June 11, 2026 22:53
Copilot AI requested a review from lpcox June 11, 2026 22:53
GitHub Advanced Security finished work on behalf of lpcox June 11, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants