From 219b174819fa01765e34f7393d3ba8cffb2728f6 Mon Sep 17 00:00:00 2001 From: Jiayuan Date: Mon, 30 Mar 2026 19:32:24 +0800 Subject: [PATCH] fix(daemon): sync workspaces immediately on startup Run syncWorkspacesFromAPI once before entering the periodic ticker loop so newly created workspaces are discovered without the initial 30-second delay. --- server/internal/daemon/daemon.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/internal/daemon/daemon.go b/server/internal/daemon/daemon.go index c4431d14..cc782df1 100644 --- a/server/internal/daemon/daemon.go +++ b/server/internal/daemon/daemon.go @@ -283,6 +283,9 @@ func (d *Daemon) configWatchLoop(ctx context.Context) { // and adds any new ones to the CLI config. The configWatchLoop will then // detect the config change and register runtimes for the new workspaces. func (d *Daemon) workspaceSyncLoop(ctx context.Context) { + // Run immediately on startup before entering the periodic loop. + d.syncWorkspacesFromAPI(ctx) + ticker := time.NewTicker(DefaultWorkspaceSyncInterval) defer ticker.Stop()