Enable analytics by default for daemon-launched app servers (#49426)

## Why

Daemon-launched app servers should use the same analytics default as first-party clients while honoring explicit user opt-outs.

## What changed

Pass `--analytics-default-enabled` when the PID backend launches an app server, with or without remote control. Users can still disable analytics with `analytics.enabled = false` in `config.toml`.

## Testing

Update argument assertions for both remote-control modes and the daemon start/restart test to expect the analytics flag alongside launch feature overrides.

GitOrigin-RevId: 8a222a00fc56737f5fe2b0385abf59466d1a6671
This commit is contained in:
Benjamin Carlsson
2026-09-30 01:35:21 +00:00
committed by copyberry
parent 8ea2c0e0d4
commit 2cc65cdd4c
3 changed files with 17 additions and 4 deletions
@@ -394,6 +394,8 @@ impl PidBackend {
}
};
if matches!(self.command_kind, PidCommandKind::AppServer { .. }) {
// Match first-party clients' default while preserving explicit analytics opt-outs.
args.push("--analytics-default-enabled".into());
for (name, enabled) in &self.feature_overrides {
args.extend(["-c".into(), format!("features.{name}={enabled}").into()]);
}
@@ -602,7 +602,13 @@ fn app_server_remote_control_uses_runtime_flag() {
assert_eq!(
backend.command_args(),
vec!["app-server", "--remote-control", "--listen", "unix://"]
vec![
"app-server",
"--remote-control",
"--listen",
"unix://",
"--analytics-default-enabled"
]
);
}
@@ -616,7 +622,12 @@ fn app_server_disabled_remote_control_uses_compatible_args_and_runtime_env() {
assert_eq!(
backend.command_args(),
vec!["app-server", "--listen", "unix://"]
vec![
"app-server",
"--listen",
"unix://",
"--analytics-default-enabled"
]
);
assert_eq!(
backend.command_env(),