mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-26 12:35:35 +02:00
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).