diff --git a/internal/api/router.go b/internal/api/router.go index cd7f8af21..6e20488e0 100644 --- a/internal/api/router.go +++ b/internal/api/router.go @@ -4866,9 +4866,11 @@ func (r *Router) handleAgentVersion(w http.ResponseWriter, req *http.Request) { return } - // Return the server version - all agents should match the server version + // Return the server version - all agents should match the server version. + // Dev/git builds return "dev" so agents don't enter an infinite update loop + // (the agent skips updates when the server reports "dev"). version := "dev" - if versionInfo, err := updates.GetCurrentVersion(); err == nil { + if versionInfo, err := updates.GetCurrentVersion(); err == nil && !versionInfo.IsDevelopment { version = versionInfo.Version }