Title: mcpx: the daemon's socket name follows the symlink-resolved config path, so a nix-managed config moves it on every content change · Issue #368 · developing-today/code · GitHub
Open Graph Title: mcpx: the daemon's socket name follows the symlink-resolved config path, so a nix-managed config moves it on every content change · Issue #368 · developing-today/code
X Title: mcpx: the daemon's socket name follows the symlink-resolved config path, so a nix-managed config moves it on every content change · Issue #368 · developing-today/code
Description: Problem FingerprintConfig (pkgs/mcpx/internal/daemon/paths.go:198) resolves each config path through filepath.EvalSymlinks and hashes the result to name the daemon's socket. When the config is a home-manager/nix link (~/.config/mcpx/conf...
Open Graph Description: Problem FingerprintConfig (pkgs/mcpx/internal/daemon/paths.go:198) resolves each config path through filepath.EvalSymlinks and hashes the result to name the daemon's socket. When the config is a ho...
X Description: Problem FingerprintConfig (pkgs/mcpx/internal/daemon/paths.go:198) resolves each config path through filepath.EvalSymlinks and hashes the result to name the daemon's socket. When the config is ...
Opengraph URL: https://github.com/developing-today/code/issues/368
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mcpx: the daemon's socket name follows the symlink-resolved config path, so a nix-managed config moves it on every content change","articleBody":"## Problem\n\n`FingerprintConfig` (pkgs/mcpx/internal/daemon/paths.go:198) resolves each config path through `filepath.EvalSymlinks` and hashes the result to name the daemon's socket. When the config is a home-manager/nix link (`~/.config/mcpx/config.json` -> `/nix/store/\u003chash>-...-home-manager-files/...` -> `/nix/store/\u003chash>-hm_.configmcpxconfig.json`), the resolved path is content-addressed, so **every change to the config's content changes the socket name**.\n\nA daemon keyed to the old name stays on it; every CLI computes the new one, finds no daemon, and (with `daemon.autostart`) starts a second, detached one. When the first daemon is later restarted it computes the new name, finds it held, exits 1 \"a daemon is already listening\", and under a supervisor that respawns it (launchd KeepAlive) loops.\n\n## Evidence (dezren39/nix, macOS, 2026-10-19)\n\n- Socket name per system generation, recomputed from the config link: generations 290-295 `3489ca4d2ea0`, 296 `539ba2d32a06`, 297-304 `541cdd605dd1`.\n- `/tmp/mcpx.err.log`: the launchd daemon restarted at 20:58 and listened on `daemon-539ba2d32a06.sock` (nix-darwin restarts agents before home-manager re-links files, so it resolved the previous link).\n- 04:48:10: a CLI-autostarted daemon (`daemon --detached --idle-exit 4h`) took `daemon-541cdd605dd1.sock`.\n- From 11:47 (next mcpx update) launchd's daemon exited 1 \"a daemon is already listening on .../daemon-541cdd605dd1.sock\" 841 times until the stray was stopped at 14:09.\n- Reproduced with real binaries on a scratch state dir: config as a symlink re-pointed to another file -> CLI cannot reach the running daemon (exit 1); config as a regular file rewritten in place -> same socket, CLI reaches it, and the daemon hot-reloads the new servers via `daemon.watchConfig`.\n\nRelated, same cause: `stampConfig` (internal/daemon/routes_settings.go:726) compares `os.Stat` mtime + size, which follows the link; every nix store file has mtime 1, so with a store-linked config only a change of byte length is noticed.\n\n## Workaround in dezren39/nix\n\nThe config is now written as a regular file at a fixed path by an activation step, and `daemon.autostart` is off (dezren39/nix, branch remove-lootbox; homeUser.nix `mcpxConfig`, mcpx.config.nix).\n\n## Suggested fix\n\n- Key the socket on the config path with only its *directory* resolved (keeps the `/tmp` -> `/private/tmp` fix the current comment was written for, paths.go:181-184), not the file's link target.\n- In `stampConfig`, include the resolved target path (or use `Lstat` + `Readlink` for links) so a re-pointed link is noticed even when the target's mtime and size match.\n- Correct the comments that say the socket name is stable across edits (paths.go:80-88).\n\n## Acceptance criteria\n\n- [ ] A test: config path is a symlink; re-point it to a different file with different content; a CLI started afterwards reaches the already-running daemon, and the daemon reloads the new content.\n- [ ] A test: same-size content change behind a re-pointed link is detected by the watch poll.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-19T20:49:31Z","url":"https://github.com/developing-today/code/issues/368"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:52cab0b0-896f-667b-4621-df40ebfafb95 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EDA6:2E0249:208E539:2B315FD:6B069B84 |
| html-safe-nonce | 2ccb66a81139445ba4db53cae3ad21bd032a004f1c7f4c71d681113ddd28dcfe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFREE2OjJFMDI0OToyMDhFNTM5OjJCMzE1RkQ6NkIwNjlCODQiLCJ2aXNpdG9yX2lkIjoiMTQ3MzM4Mzg2ODM1MzkxMTY4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e0bb32a47f7ea6ec5aff59b71c01b3b79e283094a07fcbb26653cc95b6b081b4 |
| hovercard-subject-tag | issue:5931337722 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/368/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cdbdee24e9469ac02f331fb8473f1591bcbd26b0b7a2fc63bc0ac8aa8a2fdb8c/developing-today/code/issues/368 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cdbdee24e9469ac02f331fb8473f1591bcbd26b0b7a2fc63bc0ac8aa8a2fdb8c/developing-today/code/issues/368 |
| og:image:alt | Problem FingerprintConfig (pkgs/mcpx/internal/daemon/paths.go:198) resolves each config path through filepath.EvalSymlinks and hashes the result to name the daemon's socket. When the config is a ho... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4462ff7ebfd3d551f202659f2423dae617b6849d23b1df6465dc504ef497d14a |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6d3909414814ff86ce7da4c51a0f4918a13fb41b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width