Repository navigation
cmux NEXT: machine name uses the local host name, not a DHCP/reverse-DNS gethostname - #24172
Conversation
…thostname
Red: hostName(localHost:kernel:) still returns the kernel host name, as
displayName() does on base, so a DHCP or reverse-DNS name ("dhcp-10-0-1-5")
wins over the Bonjour local host name the owner set.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fddf-7670-8279-1a511ab46d6f&host=cosmic-gray
gethostname on a Mac on DHCP or with reverse DNS returns names like "dhcp-10-0-1-5", so the machine identity (sidebar, tab badge, composer name and its hashed color) could be a junk, unstable name. displayName(), the computer-name fallback and the local daemon's identity fallbacks in RemoteTerminalService now read the Bonjour LocalHostName the owner set in Sharing (SCDynamicStoreCopyLocalHostName), and the kernel name only when that is empty. linkDeviceName, TerminalLinkResolver and ServerReachService keep the kernel name (an existing Cloud link device, every name the Mac answers to). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fddf-7670-8279-1a511ab46d6f&host=cosmic-gray
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
red: cmux-next checks (god files, concurrency, crash safety, l10n); NEW: |
|
Owned by orphan-sweep on air-blue · session |
|
Bead |
|
Found 10 test failures on Blacksmith runners: Failures
|
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15cfc-663f-7650-b9f7-64d198c6b88b&host=Air-Blue Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… configd call Review (Codex, xhigh) of #24172: the synchronous hostName() called SCDynamicStoreCopyLocalHostName on main-actor paths (tab badges via RemoteTerminalService.machineName, terminal moves). It now returns the local host name cached by a read off the main actor (the first call starts it; displayName() renews it), and the kernel name until that read is done. Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15cfc-663f-7650-b9f7-64d198c6b88b&host=Air-Blue Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review (Codex GPT-6 at xhigh via acpmux on cmux16, correctness first): SHIP at 167d6a1
|
Picks up #24292, the revert that makes the CmuxNext test targets compile again (SideOpenStripTests broke the fast tier and daemon tests on base). Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15cfc-663f-7650-b9f7-64d198c6b88b&host=Air-Blue Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review (Codex GPT-6 at xhigh via acpmux on cmux16, correctness first): SHIP at 07bfa30
|
|
Shipped in:
|
|
Shipped in:
|
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
What was wrong
MacNamefell back to the kernel host name (gethostname) for the machine identity. On a Mac on DHCP or with reverse DNS,gethostnamereturns a name likedhcp-10-0-1-5or an ISP reverse-DNS label instead of the name the owner chose. So the name cmux shows for the Mac (sidebar, tab machine badge, composer) and the color hashed from it could be junk and could change from one network to the next.Fix
MacName.hostName()(new): the Bonjour LocalHostName the owner set in System Settings > General > Sharing (SCDynamicStoreCopyLocalHostName, a configd read with no DNS lookup). It falls back to the kernel host name only when that is empty.displayName()and thecomputerName()fallback (resolve) now use it. The choice is a purenonisolated static func hostName(localHost:kernel:)/displayName(computer:localHost:kernel:).RemoteTerminalService.machineNameandRemoteTerminalService+Moves.sessionNameuseMacName().hostName().linkDeviceName()(it names an existing Cloud link device, so renaming it would break linking), plusTerminalLinkResolverandServerReachService(they match every name the Mac answers to,gethostnameincluded).Tests
MacNameHostTestsinPackages/macOS/CmuxNext/Tests/CmuxNextAppTests/MacNameTests.swift: the local host name beats a DHCP kernel name (in bothhostNameanddisplayName), and the kernel name is used when the local host name is nil, empty or blank.47e124e6e94227a8d9f3d717c48da58390b28cf5: fleet stepaacfa5cfc5b52b1313c94dcf(cmux-ci log aacfa5cfc5b52b1313c94dcf): queued on the fleet; result to follow01377c63bc7c56aca452c5b1635fb1f03abba403: fleet step335fabd9a2fc03747410333d(MacNameTests,MacNameHostTests): queued on the fleet; result to follow01377c63bc7c56aca452c5b1635fb1f03abba403:cmux-ci compile-check --appjobb9496797694eac539175fcdb: passed (61 s)check-no-godfiles.sh --only swift --base origin/feat-cmux-nexton the changed files passes.crash_ratchet.pyhas no hits in this diff; its one hit (rust acpmux unwrap 179 -> 180) is on base.No capture: name-source logic, no visual change.
Agent session: cosmic-gray
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Fixes the Mac machine name cmux shows (sidebar, tab badge, composer, and the color hashed from it) so it's the owner-set Bonjour local host name from Sharing, not the kernel host name, which DHCP or reverse DNS can replace with unstable names like
dhcp-10-0-1-5.MacName.hostName()returns the local host name viaSCDynamicStoreCopyLocalHostName(no DNS lookup) and falls back to the kernel host name only when empty; it answers from a cached read done off the main actor, so main-actor paths never wait on configd.displayName(), the computer-name fallback, and the local daemon's identity fallbacks inRemoteTerminalServicenow use it.linkDeviceName,TerminalLinkResolver, andServerReachServiceintentionally keep the kernel host name.Written for commit 07bfa30. Summary will update on new commits.