Apply feature overrides when restarting the app-server daemon (#53751)

## Why

`codex app-server daemon restart` previously reused saved settings without applying feature flags supplied on the command line.

## What changed

Apply `--enable`, `--disable`, and boolean `-c features.*` overrides during an explicit restart and persist them for subsequent restarts. Accept nested `enabled` values, normalize feature aliases, and replace conflicting saved aliases while preserving unrelated settings.

Reject invalid feature toggles before stopping the daemon or saving settings.

## Testing

Add integration coverage for overrides on stopped and running daemons, alias replacement, preservation of saved settings, restarts without flags, and rejection of non-toggle keys without interrupting the running daemon.

GitOrigin-RevId: 14a657bc4758b9c248e363f9dac58f8887070a04
This commit is contained in:
jif
2026-10-13 19:36:44 +00:00
committed by copyberry
parent 5d4922595a
commit e762c05bd6
8 changed files with 157 additions and 10 deletions
@@ -869,7 +869,7 @@ async fn daemon_start_and_restart_preserve_launch_features() {
);
assert_eq!(std::fs::read_to_string(&args_path).unwrap(), expected);
std::fs::remove_file(&args_path).unwrap();
let restarted = daemon.restart().await;
let restarted = daemon.restart(&std::collections::BTreeMap::new()).await;
let deadline = tokio::time::Instant::now() + Duration::from_secs(/*secs*/ 10);
while std::fs::read_to_string(&args_path).ok().as_deref() != Some(expected)
&& tokio::time::Instant::now() < deadline