Document startup auto-update flow

This commit is contained in:
Yaroslav Volovich
2026-02-25 18:52:09 +00:00
parent 76b25805bf
commit 5d17805f66
2 changed files with 19 additions and 0 deletions

View File

@@ -1,3 +1,10 @@
//! End-to-end PTY coverage for the startup auto-update handoff.
//!
//! This test seeds cached update state and a fake `npm` on `PATH`, then runs
//! the real `codex` binary. Its job is to document and enforce the contract
//! that startup reuses the existing updater path and preserves the updater
//! working directory and argv.
use std::collections::HashMap;
use std::time::Duration;

View File

@@ -1,4 +1,9 @@
#![cfg(not(debug_assertions))]
//! Renders the startup update prompt and reports which startup path to take.
//!
//! This module owns the selection layer for update prompts. It decides whether
//! startup should continue normally or hand control back to the CLI to run an
//! updater command, but it does not execute the updater itself.
use crate::history_cell::padded_emoji;
use crate::key_hint;
@@ -28,8 +33,15 @@ use ratatui::widgets::Clear;
use ratatui::widgets::WidgetRef;
use tokio_stream::StreamExt;
/// Describes what startup should do after resolving update prompt state.
///
/// The TUI returns this instead of spawning updater processes directly so the
/// CLI remains the single owner of command execution, exit behavior, and
/// update status messaging.
pub(crate) enum UpdatePromptOutcome {
/// Proceed into the normal TUI startup path.
Continue,
/// Exit startup and run the detected updater command through the CLI.
RunUpdate(UpdateAction),
}