Use ProcessInfo.hostName for postd SSE log line#26
Merged
Conversation
The HTTP+SSE startup log built its URL with String.localHostname, a helper SwiftMCP 1.5 removed. The daemon still compiled β and CI stayed green β only because SwiftMail 1.6.4 vends an identical String.localHostname that leaks into PostDaemon.swift through PostServer's transitive import. That's fragile on two counts: SwiftMail may drop it (its ecosystem already flagged it as an API smell, and SwiftCross replaced it with ProcessInfo.hostName / ProcessInfo.localIPAddress), and SE-0444 member-import-visibility would require a direct `import SwiftMail`. Use Foundation's ProcessInfo.processInfo.hostName directly: behavior- preserving (the old helper returned hostName first), no new dependency, and the same default SwiftMCP's own HTTPSSETransport uses for `host`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
postd's HTTP+SSE startup log built its URL withString.localHostname:SwiftMCP 1.5 (pulled in by #25) removed that helper. A Codex review on #25 flagged this as a P1 "won't compile" β but it was a false positive: the daemon kept building and CI stayed green, because SwiftMail 1.6.4 still vends an identical
String.localHostnamethat leaks intoPostDaemon.swiftthroughPostServer's transitiveimport SwiftMail. CI compiles every target (swift build, debug + release, macOS + Linux), so a real break there would have gone red.So nothing was broken β but the green build leaned on two fragile things:
localHostname. SwiftCross's own commit dropping it called it an "API smell inherited from SwiftMail/SwiftMCP," replacing it with the built-inProcessInfo.hostNameplus a newProcessInfo.localIPAddress. SwiftMail's copy is a likely future removal.MemberImportVisibility) would eventually turn into an error requiring a directimport SwiftMail.Change
Use Foundation's
ProcessInfo.processInfo.hostNamedirectly:ProcessInfo.processInfo.hostNamefirst (IP/localhostonly as fallbacks);HTTPSSETransport.initdefaults itshosttoProcessInfo.processInfo.hostName.Verification
swift buildβ βpost+postdlink cleanly against the pinned SwiftMCP 1.5.1 / SwiftMail 1.6.4.π€ Generated with Claude Code