diff --git a/machinery/src/computervision/main.go b/machinery/src/computervision/main.go index 8828efc..b6f1f7c 100644 --- a/machinery/src/computervision/main.go +++ b/machinery/src/computervision/main.go @@ -47,7 +47,7 @@ func ProcessMotion(motionCursor *packets.QueueCursor, configuration *models.Conf if motionDisabled { - log.Log.Info("computervision.main.ProcessMotion(): motion detection disabled (pixelChangeThreshold set to 0), skipping.") + log.Log.Warning("computervision.main.ProcessMotion(): motion detection is DISABLED because pixelChangeThreshold is set to 0 (nil/unset would default to 150). If motion detection is expected to be running, set capture.pixelChangeThreshold to a positive value (150 recommended) or AGENT_CAPTURE_PIXEL_CHANGE, then restart/update the agent.") } else if continuousMode && !hasMotionRegion { diff --git a/machinery/src/config/main.go b/machinery/src/config/main.go index 3b93828..b3589b5 100644 --- a/machinery/src/config/main.go +++ b/machinery/src/config/main.go @@ -648,6 +648,17 @@ func applyAgentEnvVars(configuration *models.Configuration, prefix string, apply } } + // Motion sensitivity: nil/unset must still resolve to the default (150), not + // be left nil. An explicit 0 (temporary "disable motion detection" switch + // from the UI) is a real, non-nil value and must NOT be touched here. Only + // applied for the effective configuration (applyDefaults), not for the + // separate global/custom views, so a missing value in one layer can still be + // inherited from the other instead of being masked by this default. + if applyDefaults && configuration.Config.Capture.PixelChangeThreshold == nil { + defaultPixelChangeThreshold := 150 + configuration.Config.Capture.PixelChangeThreshold = &defaultPixelChangeThreshold + } + // Signing is a new feature, so if empty we set default values. Only applied // for the effective configuration (applyDefaults), not for the separate // global/custom views.