Add /daemon menu for local background server updates (#45854)

## Why

Local daemon version warnings direct users to a shell command. Provide an update flow from the TUI with an explicit choice of package source and confirmation before exiting.

## What changed

- Add `/daemon` with options to install the latest public stable release or use the current CLI package. Point local server version notices to the menu.
- Default confirmation to Cancel and explain restart, interruption, and relaunch behavior. After confirmation, exit the TUI and run the update through the launching CLI executable, propagating failures.
- Keep maintenance available when disconnected or using the embedded server. Disable updates for remote connections or a missing CLI executable, and disable copying the CLI build when no local package is available.

## Testing

Add menu snapshots and interaction tests covering both update sources, cancellation, and unavailable actions. Add a Unix CLI handoff test verifying the selected executable, command arguments, and failure propagation.

GitOrigin-RevId: 06b485feb5650673ec7dd00adda01fedb8909393
This commit is contained in:
Eric Traut authored and copyberry committed 2026-09-16 03:43:59 +00:00
1 parent 7322c5e790
commit 04581f9604
31 files changed
+544 -18

No files matched your search

+3 -2
View File
@@ -97,8 +97,9 @@ pub(crate) fn new_server_version_warning(
) -> PrefixedWrappedHistoryCell {
let mut lines = vec![Line::from(notice.message.yellow())];
if notice.offer_update {
lines.push(Line::from("To update the service, run:".yellow()));
lines.push(Line::from(" codex app-server daemon update".cyan()));
lines.push(Line::from(
"Use /daemon to manage the local background server.".cyan(),
));
lines.push(Line::from(
"Updating may interrupt active or queued work.".yellow(),
));
@@ -3,6 +3,5 @@ source: tui/src/history_cell/tests.rs
expression: "render_lines(&cell.display_lines(100)).join(\"\\n\")"
---
⚠ A background Codex service is running v0.152.1, older than your Codex CLI v0.153.0.
To update the service, run:
codex app-server daemon update
Use /daemon to manage the local background server.
Updating may interrupt active or queued work.