Skip to content

cmux NEXT: machine name uses the local host name, not a DHCP/reverse-DNS gethostname - #24172

Merged
teamleaderleo merged 5 commits into
feat-cmux-nextfrom
machine-name-stable-host
Oct 22, 2026
Merged

teamleaderleo merged 5 commits into
feat-cmux-nextfrom
machine-name-stable-host

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

What was wrong

MacName fell back to the kernel host name (gethostname) for the machine identity. On a Mac on DHCP or with reverse DNS, gethostname returns a name like dhcp-10-0-1-5 or 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 the computerName() fallback (resolve) now use it. The choice is a pure nonisolated static func hostName(localHost:kernel:) / displayName(computer:localHost:kernel:).
  • The local daemon's identity fallbacks in RemoteTerminalService.machineName and RemoteTerminalService+Moves.sessionName use MacName().hostName().
  • Unchanged on purpose: linkDeviceName() (it names an existing Cloud link device, so renaming it would break linking), plus TerminalLinkResolver and ServerReachService (they match every name the Mac answers to, gethostname included).

Tests

MacNameHostTests in Packages/macOS/CmuxNext/Tests/CmuxNextAppTests/MacNameTests.swift: the local host name beats a DHCP kernel name (in both hostName and displayName), and the kernel name is used when the local host name is nil, empty or blank.

  • Red, test-only commit 47e124e6e94227a8d9f3d717c48da58390b28cf5: fleet step aacfa5cfc5b52b1313c94dcf (cmux-ci log aacfa5cfc5b52b1313c94dcf): queued on the fleet; result to follow
  • Green, head 01377c63bc7c56aca452c5b1635fb1f03abba403: fleet step 335fabd9a2fc03747410333d (MacNameTests,MacNameHostTests): queued on the fleet; result to follow
  • App compile, head 01377c63bc7c56aca452c5b1635fb1f03abba403: cmux-ci compile-check --app job b9496797694eac539175fcdb: passed (61 s)
  • Local: check-no-godfiles.sh --only swift --base origin/feat-cmux-next on the changed files passes. crash_ratchet.py has 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


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with 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.

  • New MacName.hostName() returns the local host name via SCDynamicStoreCopyLocalHostName (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 in RemoteTerminalService now use it.
  • linkDeviceName, TerminalLinkResolver, and ServerReachService intentionally keep the kernel host name.

Written for commit 07bfa30. Summary will update on new commits.

View guided diff Turn on auto-fix

teamleaderleo and others added 2 commits October 21, 2026 19:38
…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
@teamleaderleo teamleaderleo added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 22, 2026
@cursor

cursor Bot commented Oct 22, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot 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.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 07bfa30: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr24172 -f ref=machine-name-stable-host -f platform=macos -f backend_mode=local

red: cmux-next checks (god files, concurrency, crash safety, l10n); NEW: red check: Checks job structure (+1 more) is not red on the base e12eb09; do not merge until green; see lane-rules

@teamleaderleo

teamleaderleo commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator Author

Owned by orphan-sweep on air-blue · session

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-3owja created for this PR by the cmux coordinator.

@blacksmith-sh

blacksmith-sh Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Found 10 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmpmi_5kcid/summary-fail.json (live):/summary-fail.json (live): View Logs
/tmp/tmpplrzhnaw/summary-missing.json (live):/summary-missing.json (live): View Logs
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows/
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows
View Logs
[new_workspaces] the window draws no frames/[new_workspaces] the window draws no frames View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs
convention violations found (ERROR lines above)./
convention violations found (ERROR lines above).
View Logs
test_every_part_of_bun_run_check_runs_in_the_warn_branch (main.WebviewsWarnSplitCov
ersCheck.test_every_part_of_bun_run_check_runs_in_the_warn_branch)/
test_every_part_of_bun_run_check_runs_in_the_warn_branch (main.WebviewsWarnSplitCov
ersCheck.test_every_part_of_bun_run_check_runs_in_the_warn_branch)
View Logs
test_every_submodule_free_checkout_on_an_owned_runner_resets_submodules (main.Reuse
dWorkspaceSubmodules.test_every_submodule_free_checkout_on_an_owned_runner_resets_submo
dules)/
test_every_submodule_free_checkout_on_an_owned_runner_resets_submodules (main.Reuse
dWorkspaceSubmodules.test_every_submodule_free_checkout_on_an_owned_runner_resets_submo
dules)
View Logs
test_every_submodule_free_checkout_on_an_owned_runner_resets_submodules (main.Reuse
dWorkspaceSubmodules.test_every_submodule_free_checkout_on_an_owned_runner_resets_submo
dules) (job='web-bundles')/
test_every_submodule_free_checkout_on_an_owned_runner_resets_submodules (main.Reuse
dWorkspaceSubmodules.test_every_submodule_free_checkout_on_an_owned_runner_resets_submo
dules) (job='web-bundles')
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

… 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>
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (Codex GPT-6 at xhigh via acpmux on cmux16, correctness first): SHIP at 167d6a1

  • First pass at 4f4c16c (a clean base merge): BLOCK, P2. The synchronous MacName.hostName() called SCDynamicStoreCopyLocalHostName (configd IPC) on main-actor paths: RemoteTerminalService.machineName (tab badges via PaneController) and RemoteTerminalService+Moves.sessionName.
  • Fixed in 167d6a1: hostName() does no IPC now. It answers from the local host name that an off-main read cached (CmuxNextCompat Mutex), and gives the kernel name until that read is done. Its first call starts a one-shot detached read, and displayName() and the computerName() fallback renew the cache. check-concurrency.sh passes.
  • Second pass at 167d6a1: SHIP. No Swift 6 concurrency, access-control, identity-routing, Cloud-link or showcase (Showcase runs name a fixture Mac, never the capture host #24123) regressions.
  • Not fixed (nonblocking): the new test checks the cached value but would not catch synchronous IPC coming back.
  • Fleet cmux-ci compile-check --app at 167d6a1: passed (job 0c94db9581eb46b6343dffa5).

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>
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (Codex GPT-6 at xhigh via acpmux on cmux16, correctness first): SHIP at 07bfa30

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

Shipped in:

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 07bfa305 Deployed Oct 22, 2026 by teamleaderleo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant