debug linux plugin mention resolution

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Sayan Sisodiya
2026-03-04 19:54:42 -08:00
parent 584919cd54
commit 7fe4a43713
2 changed files with 39 additions and 0 deletions

View File

@@ -4944,6 +4944,25 @@ pub(crate) async fn run_turn(
// enabled plugins, then converted into turn-scoped guidance below.
let mentioned_plugins =
collect_explicit_plugin_mentions(&input, loaded_plugins.capability_summaries());
info!(
plugin_input_texts = ?input
.iter()
.filter_map(|item| match item {
UserInput::Text { text, .. } => Some(text.as_str()),
_ => None,
})
.collect::<Vec<_>>(),
available_plugins = ?loaded_plugins
.capability_summaries()
.iter()
.map(|plugin| plugin.display_name.as_str())
.collect::<Vec<_>>(),
mentioned_plugins = ?mentioned_plugins
.iter()
.map(|plugin| plugin.display_name.as_str())
.collect::<Vec<_>>(),
"resolved explicit plugin mentions for turn"
);
let mcp_tools =
if turn_context.config.features.enabled(Feature::Apps) || !mentioned_plugins.is_empty() {
// Plugin mentions need raw MCP/app inventory even when app tools

View File

@@ -30,6 +30,7 @@ use std::fs;
use std::path::Path;
use std::path::PathBuf;
use std::sync::RwLock;
use tracing::info;
use tracing::warn;
const DEFAULT_SKILLS_DIR_NAME: &str = "skills";
@@ -258,6 +259,7 @@ impl PluginsManager {
force_reload: bool,
) -> PluginLoadOutcome {
if !plugins_feature_enabled_from_stack(config_layer_stack) {
info!(cwd = ?cwd, "plugins disabled in config layer stack");
let mut cache = match self.cache_by_cwd.write() {
Ok(cache) => cache,
Err(err) => err.into_inner(),
@@ -267,11 +269,29 @@ impl PluginsManager {
}
if !force_reload && let Some(outcome) = self.cached_outcome_for_cwd(cwd) {
info!(
cwd = ?cwd,
plugin_display_names = ?outcome
.capability_summaries()
.iter()
.map(|plugin| plugin.display_name.as_str())
.collect::<Vec<_>>(),
"plugins cache hit"
);
return outcome;
}
let outcome = load_plugins_from_layer_stack(config_layer_stack, &self.store);
log_plugin_load_errors(&outcome);
info!(
cwd = ?cwd,
plugin_display_names = ?outcome
.capability_summaries()
.iter()
.map(|plugin| plugin.display_name.as_str())
.collect::<Vec<_>>(),
"plugins loaded from config layer stack"
);
let mut cache = match self.cache_by_cwd.write() {
Ok(cache) => cache,
Err(err) => err.into_inner(),