mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
Preserve GOOSE_TELEMETRY_OFF override in set_telemetry_enabled
The env-var kill switch is a hard disable. Prevent config writes from re-enabling telemetry when GOOSE_TELEMETRY_OFF is set. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -59,7 +59,9 @@ pub fn is_telemetry_enabled() -> bool {
|
||||
/// changed so that Sentry callbacks and other hot paths see the new
|
||||
/// state immediately.
|
||||
pub fn set_telemetry_enabled(enabled: bool) {
|
||||
TELEMETRY_ENABLED.store(enabled, Ordering::Relaxed);
|
||||
// GOOSE_TELEMETRY_OFF is a hard kill switch; never allow re-enabling.
|
||||
let effective = enabled && !TELEMETRY_DISABLED_BY_ENV.load(Ordering::Relaxed);
|
||||
TELEMETRY_ENABLED.store(effective, Ordering::Relaxed);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user