Files
Jiang Bohan b62c7b83ae fix(daemon): machine-scoped daemon.id so CLI and Desktop share one identity
Dev found that starting Desktop after CLI (or vice versa) minted a second
runtime row per provider instead of re-binding to the existing one. Root
cause: EnsureDaemonID wrote under the profile directory, so the CLI daemon
(default profile) and the Desktop daemon (its own `desktop-<host>` profile)
each generated their own UUID even though they're the same machine.

daemon.id now lives at `~/.multica/daemon.id` only — machine-scoped, not
profile-scoped. Profiles still own their own config.json / log / token;
only identity is shared. With one id per machine, the existing unique
constraint `(workspace_id, daemon_id, provider)` naturally collapses
CLI+Desktop into a single runtime row per provider.

Test reversal: replaced TestEnsureDaemonID_ProfileIsolated with
TestEnsureDaemonID_MachineScopedAcrossProfiles, which pins the new
invariant (two sequential calls return the same UUID; no per-profile
daemon.id is written).
2026-04-17 15:27:22 +08:00
..