mirror of
https://github.com/openai/codex.git
synced 2026-05-02 18:37:01 +00:00
Support disabling tool suggest for specific tools. (#20072)
## Summary - Add `disable_tool_suggest` to app and plugin config, schema, and TypeScript output - Exclude disabled connectors and plugins from tool suggestion discovery - Persist "never show again" tool-suggestion choices back into `config.toml` - Update config docs and add coverage for connector and plugin suppression ## Testing - Added and updated unit tests for config persistence and tool-suggest filtering - Not run (not requested)
This commit is contained in:
@@ -186,11 +186,45 @@ pub struct ToolSuggestDiscoverable {
|
||||
pub id: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, Hash, JsonSchema)]
|
||||
#[schemars(deny_unknown_fields)]
|
||||
pub struct ToolSuggestDisabledTool {
|
||||
#[serde(rename = "type")]
|
||||
pub kind: ToolSuggestDiscoverableType,
|
||||
pub id: String,
|
||||
}
|
||||
|
||||
impl ToolSuggestDisabledTool {
|
||||
pub fn plugin(id: impl Into<String>) -> Self {
|
||||
Self {
|
||||
kind: ToolSuggestDiscoverableType::Plugin,
|
||||
id: id.into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn connector(id: impl Into<String>) -> Self {
|
||||
Self {
|
||||
kind: ToolSuggestDiscoverableType::Connector,
|
||||
id: id.into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn normalized(&self) -> Option<Self> {
|
||||
let id = self.id.trim();
|
||||
(!id.is_empty()).then(|| Self {
|
||||
kind: self.kind,
|
||||
id: id.to_string(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, Default, JsonSchema)]
|
||||
#[schemars(deny_unknown_fields)]
|
||||
pub struct ToolSuggestConfig {
|
||||
#[serde(default)]
|
||||
pub discoverables: Vec<ToolSuggestDiscoverable>,
|
||||
#[serde(default)]
|
||||
pub disabled_tools: Vec<ToolSuggestDisabledTool>,
|
||||
}
|
||||
|
||||
/// Memories settings loaded from config.toml.
|
||||
|
||||
Reference in New Issue
Block a user