diff --git a/apps/web/features/runtimes/components/runtime-detail.tsx b/apps/web/features/runtimes/components/runtime-detail.tsx index 3e124ff3..286a3670 100644 --- a/apps/web/features/runtimes/components/runtime-detail.tsx +++ b/apps/web/features/runtimes/components/runtime-detail.tsx @@ -6,8 +6,12 @@ import { UpdateSection } from "./update-section"; import { UsageSection } from "./usage-section"; function getCliVersion(metadata: Record): string | null { - if (metadata && typeof metadata.version === "string" && metadata.version) { - return metadata.version; + if ( + metadata && + typeof metadata.cli_version === "string" && + metadata.cli_version + ) { + return metadata.cli_version; } return null; } diff --git a/server/cmd/multica/cmd_daemon.go b/server/cmd/multica/cmd_daemon.go index f7bd4965..bd2bda18 100644 --- a/server/cmd/multica/cmd_daemon.go +++ b/server/cmd/multica/cmd_daemon.go @@ -263,6 +263,7 @@ func runDaemonForeground(cmd *cobra.Command) error { if err != nil { return err } + cfg.CLIVersion = version ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) defer stop() diff --git a/server/internal/daemon/config.go b/server/internal/daemon/config.go index cd2bf7e7..e8a033ab 100644 --- a/server/internal/daemon/config.go +++ b/server/internal/daemon/config.go @@ -28,6 +28,7 @@ type Config struct { DaemonID string DeviceName string RuntimeName string + CLIVersion string // multica CLI version (e.g. "0.1.13") Profile string // profile name (empty = default) Agents map[string]AgentEntry // "claude" -> entry, "codex" -> entry WorkspacesRoot string // base path for execution envs (default: ~/multica_workspaces) diff --git a/server/internal/daemon/daemon.go b/server/internal/daemon/daemon.go index cabbf60c..29621a3b 100644 --- a/server/internal/daemon/daemon.go +++ b/server/internal/daemon/daemon.go @@ -254,6 +254,7 @@ func (d *Daemon) registerRuntimesForWorkspace(ctx context.Context, workspaceID s "workspace_id": workspaceID, "daemon_id": d.cfg.DaemonID, "device_name": d.cfg.DeviceName, + "cli_version": d.cfg.CLIVersion, "runtimes": runtimes, } diff --git a/server/internal/handler/daemon.go b/server/internal/handler/daemon.go index 937ddf9a..bab4ce4d 100644 --- a/server/internal/handler/daemon.go +++ b/server/internal/handler/daemon.go @@ -23,10 +23,11 @@ type DaemonRegisterRequest struct { WorkspaceID string `json:"workspace_id"` DaemonID string `json:"daemon_id"` DeviceName string `json:"device_name"` + CLIVersion string `json:"cli_version"` // multica CLI version Runtimes []struct { Name string `json:"name"` Type string `json:"type"` - Version string `json:"version"` + Version string `json:"version"` // agent CLI version (claude/codex) Status string `json:"status"` } `json:"runtimes"` } @@ -90,7 +91,8 @@ func (h *Handler) DaemonRegister(w http.ResponseWriter, r *http.Request) { status = "offline" } metadata, _ := json.Marshal(map[string]any{ - "version": runtime.Version, + "version": runtime.Version, + "cli_version": req.CLIVersion, }) registered, err := h.Queries.UpsertAgentRuntime(r.Context(), db.UpsertAgentRuntimeParams{