Skip to content

Use borrowed zero-allocation check for search capability in PluginManager::search_filtered#924

Merged
multiplex55 merged 1 commit intomasterfrom
codex/update-capability-check-in-pluginmanager
Mar 8, 2026
Merged

Use borrowed zero-allocation check for search capability in PluginManager::search_filtered#924
multiplex55 merged 1 commit intomasterfrom
codex/update-capability-check-in-pluginmanager

Conversation

@multiplex55
Copy link
Copy Markdown
Owner

Motivation

  • Avoid allocating a String just to check whether a plugin's enabled capabilities include "search", and ensure plugins without that capability are skipped during search routing.

Description

  • Replace caps.contains(&"search".to_string()) with a zero-allocation borrowed comparison caps.iter().any(|c| c == "search") in PluginManager::search_filtered.
  • Add unit test search_capability_gate_skips_plugin_when_disabled in tests/plugin_routing.rs to verify a plugin is skipped when its enabled capabilities do not include "search".
  • Did not migrate capability storage to a HashSet in this change; Vec<String> callsites remain unchanged for minimal scope.

Testing

  • Ran cargo fmt --all, which succeeded.
  • Attempted cargo test --test plugin_routing and cargo test --test plugin_routing --no-default-features, but both failed in this environment due to a missing system alsa development library required by alsa-sys, so the new test could not be executed here.

Codex Task

@multiplex55 multiplex55 merged commit dd50b27 into master Mar 8, 2026
1 check passed
@multiplex55 multiplex55 deleted the codex/update-capability-check-in-pluginmanager branch March 8, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant