Refactor semantic clustering: collapse thin server/logger files and extract proxy address helper#6831
Merged
Merged
Conversation
Closed
5 tasks
Copilot
AI
changed the title
[WIP] Refactor semantic function clustering by consolidating thin files
Refactor semantic clustering: collapse thin server/logger files and extract proxy address helper
Jun 1, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Pure refactor that consolidates thin wrapper files in internal/server and internal/logger, and extracts an outlier helper from internal/cmd/proxy.go into its own file. No behavior changes.
Changes:
- Move
CreateHTTPServerForMCP(andlogTransport) from deletedinternal/server/transport.gointointernal/server/http_server.go. - Move
StartupInfo/StartupWarnfrom deletedinternal/logger/startup.gointointernal/logger/global_helpers.go. - Extract unexported
clientAddrfrominternal/cmd/proxy.gointo newinternal/cmd/addr.go.
Show a summary per file
| File | Description |
|---|---|
| internal/server/transport.go | Deleted; contents relocated to http_server.go. |
| internal/server/http_server.go | Adds CreateHTTPServerForMCP and logTransport next to the shared HTTP scaffold. |
| internal/logger/startup.go | Deleted; helpers moved to global_helpers.go. |
| internal/logger/global_helpers.go | Adds StartupInfo / StartupWarn and a log import. |
| internal/cmd/proxy.go | Removes clientAddr helper. |
| internal/cmd/addr.go | New file holding the clientAddr helper. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 6/6 changed files
- Comments generated: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses the semantic-function refactor findings by removing two thin wrapper files and relocating one outlier utility function to a focused helper file. Behavior is preserved while tightening package organization and reducing indirection.
Server HTTP construction co-location
CreateHTTPServerForMCPintointernal/server/http_server.go, next tobuildMCPHTTPServerandnewHTTPServer.internal/server/transport.go(single-function wrapper file).Logger startup helper consolidation
StartupInfoandStartupWarnintointernal/logger/global_helpers.gowith other global logger helpers.internal/logger/startup.go(two-function wrapper file).Proxy address utility extraction
clientAddrfrominternal/cmd/proxy.gointointernal/cmd/addr.go.cmdscope (unexported) to preserve current call sites and tests while removing the outlier from the main proxy command flow.