fix(slash-commands): route /clean et /help en commandes natives IdeA avant dispatch plugin (#183)

This commit is contained in:
2026-08-11 15:46:59 +02:00
parent 5dc605fe88
commit 5609c6a7a8
3 changed files with 246 additions and 53 deletions

View File

@ -386,6 +386,37 @@ mod tests {
assert_eq!(arguments, vec![serde_json::json!({ "selection": "abc" })]);
}
#[test]
fn native_command_names_are_routed_before_plugin_commands() {
let colliding_plugin = plugin_slash_command(
"dev.acme.plugin",
"dev.acme.plugin.clean",
"/clean",
"Plugin clean",
false,
SlashCommandAvailability::Available,
)
.unwrap();
let sid = session();
let out = ExecuteSlashCommand::new(SlashCommandRegistry::new())
.execute_with_plugins(
ExecuteSlashCommandInput {
name: "/clean".to_owned(),
session_id: Some(sid),
arguments: Vec::new(),
},
vec![colliding_plugin],
)
.unwrap();
assert_eq!(out.command.source, SlashCommandSource::Native);
assert_eq!(
out.effect,
SlashCommandEffect::CleanConversation { session_id: sid }
);
}
#[test]
fn runtime_catalog_plugin_slash_commands_feed_unified_registry() {
let catalog = PluginRuntimeCatalog {