Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Refresh mentions list after plugin install/uninstall (#15598)

canvrno-oai0f90a3467699
diff --git a/codex-rs/tui/src/app.rs b/codex-rs/tui/src/app.rs
index 5b43840b49..56e542f597 100644
--- a/codex-rs/tui/src/app.rs
+++ b/codex-rs/tui/src/app.rs
@@ -1033,6 +1033,7 @@ impl App {
.await?;
self.apply_runtime_policy_overrides(&mut config);
self.config = config;
+ self.chat_widget.sync_plugin_mentions_config(&self.config);
Ok(())
}
@@ -3181,6 +3182,7 @@ impl App {
if let Err(err) = self.refresh_in_memory_config_from_disk().await {
tracing::warn!(error = %err, "failed to refresh config after plugin install");
}
+ self.chat_widget.refresh_plugin_mentions();
self.chat_widget.submit_op(Op::ReloadUserConfig);
}
let should_refresh_plugin_detail = self.chat_widget.on_plugin_install_loaded(
@@ -3634,6 +3636,7 @@ impl App {
"failed to refresh config after plugin uninstall"
);
}
+ self.chat_widget.refresh_plugin_mentions();
self.chat_widget.submit_op(Op::ReloadUserConfig);
}
self.chat_widget.on_plugin_uninstall_loaded(
diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs
index 91f6159329..84dfc62fcc 100644
--- a/codex-rs/tui/src/chatwidget.rs
+++ b/codex-rs/tui/src/chatwidget.rs
@@ -9124,7 +9124,7 @@ impl ChatWidget {
self.bottom_pane.set_connectors_snapshot(Some(snapshot));
}
- fn refresh_plugin_mentions(&mut self) {
+ pub(crate) fn refresh_plugin_mentions(&mut self) {
if !self.config.features.enabled(Feature::Plugins) {
self.bottom_pane.set_plugin_mentions(/*plugins*/ None);
return;
@@ -9137,6 +9137,11 @@ impl ChatWidget {
self.bottom_pane.set_plugin_mentions(Some(plugins));
}
+ pub(crate) fn sync_plugin_mentions_config(&mut self, config: &Config) {
+ self.config.features = config.features.clone();
+ self.config.config_layer_stack = config.config_layer_stack.clone();
+ }
+
pub(crate) fn open_review_popup(&mut self) {
let mut items: Vec<SelectionItem> = Vec::new();
diff --git a/codex-rs/tui_app_server/src/app.rs b/codex-rs/tui_app_server/src/app.rs
index bb36d83949..29da170b82 100644
--- a/codex-rs/tui_app_server/src/app.rs
+++ b/codex-rs/tui_app_server/src/app.rs
@@ -1032,6 +1032,7 @@ impl App {
.await?;
self.apply_runtime_policy_overrides(&mut config);
self.config = config;
+ self.chat_widget.sync_plugin_mentions_config(&self.config);
Ok(())
}
@@ -3684,6 +3685,7 @@ impl App {
if let Err(err) = self.refresh_in_memory_config_from_disk().await {
tracing::warn!(error = %err, "failed to refresh config after plugin install");
}
+ self.chat_widget.refresh_plugin_mentions();
self.chat_widget.submit_op(AppCommand::reload_user_config());
}
let should_refresh_plugin_detail = self.chat_widget.on_plugin_install_loaded(
@@ -4160,6 +4162,7 @@ impl App {
"failed to refresh config after plugin uninstall"
);
}
+ self.chat_widget.refresh_plugin_mentions();
self.chat_widget.submit_op(AppCommand::reload_user_config());
}
self.chat_widget.on_plugin_uninstall_loaded(
diff --git a/codex-rs/tui_app_server/src/chatwidget.rs b/codex-rs/tui_app_server/src/chatwidget.rs
index 923e96b02b..95e5f27a77 100644
--- a/codex-rs/tui_app_server/src/chatwidget.rs
+++ b/codex-rs/tui_app_server/src/chatwidget.rs
@@ -10302,7 +10302,7 @@ impl ChatWidget {
self.bottom_pane.set_connectors_snapshot(Some(snapshot));
}
- fn refresh_plugin_mentions(&mut self) {
+ pub(crate) fn refresh_plugin_mentions(&mut self) {
if !self.config.features.enabled(Feature::Plugins) {
self.bottom_pane.set_plugin_mentions(/*plugins*/ None);
return;
@@ -10315,6 +10315,11 @@ impl ChatWidget {
self.bottom_pane.set_plugin_mentions(Some(plugins));
}
+ pub(crate) fn sync_plugin_mentions_config(&mut self, config: &Config) {
+ self.config.features = config.features.clone();
+ self.config.config_layer_stack = config.config_layer_stack.clone();
+ }
+
pub(crate) fn open_review_popup(&mut self) {
let mut items: Vec<SelectionItem> = Vec::new();