Surface automatic marketplace update failures as startup warnings (#57166)

## Why

Automatic marketplace update failures were only logged, leaving users without a visible startup warning.

## What changed

Send marketplace update errors and task startup failures through app-server warning notifications. Queue background warnings until a client initializes in both standalone and in-process servers, and centralize startup configuration warning delivery.

## Testing

Add a TUI integration test and snapshot covering two marketplace name mismatch failures, the warning count, and navigation between their details with `F2` and the arrow keys.

GitOrigin-RevId: af55a5555affd9d89ac15a546163daeaafd3b3e8
This commit is contained in:
Dmitriy Kovalenko
2026-10-26 17:56:43 +00:00
committed by copyberry
parent 108cf2975a
commit 2d3de37834
12 changed files with 256 additions and 39 deletions
+12
View File
@@ -145,6 +145,7 @@ use std::time::Instant;
use tokio::sync::OnceCell;
use tokio::sync::OwnedSemaphorePermit;
use tokio::sync::Semaphore;
use tokio::sync::mpsc;
use tokio::sync::watch;
use tracing::instrument;
use tracing::warn;
@@ -2869,11 +2870,13 @@ impl PluginsManager {
})
}
/// Starts background tasks and sends marketplace upgrade warnings through the supplied channel.
pub fn maybe_start_plugin_startup_tasks_for_config(
self: &Arc<Self>,
config: &PluginsConfigInput,
reload_config: ConfigLayerReload,
on_effective_plugins_changed: Option<EffectivePluginsChangedCallback>,
upgrade_warnings: mpsc::UnboundedSender<String>,
) {
if config.plugins_enabled {
self.maybe_start_curated_repo_sync_for_config(
@@ -2897,6 +2900,7 @@ impl PluginsManager {
let config = config.clone();
let on_effective_plugins_changed = on_effective_plugins_changed.clone();
let runtime = tokio::runtime::Handle::current();
let task_warnings = upgrade_warnings.clone();
if let Err(err) = std::thread::Builder::new()
.name("plugins-marketplace-auto-upgrade".to_string())
.spawn(move || {
@@ -2924,10 +2928,16 @@ impl PluginsManager {
error = %error.message,
"failed to auto-upgrade configured marketplace"
);
let _ = task_warnings.send(format!(
"Codex could not update marketplace `{}`: {}",
error.marketplace_name, error.message
));
}
}
Err(err) => {
warn!("failed to auto-upgrade configured marketplaces: {err}");
let _ = task_warnings
.send(format!("Codex could not update marketplaces: {err}"));
}
}
@@ -2944,6 +2954,8 @@ impl PluginsManager {
};
state.in_flight = false;
warn!("failed to start configured marketplace auto-upgrade task: {err}");
let _ = upgrade_warnings
.send(format!("Codex could not start marketplace updates: {err}"));
}
}
let config_for_remote_sync = config.clone();