mirror of
https://github.com/openai/codex.git
synced 2026-11-12 21:20:34 +00:00
Track plugin completion per suggested tool
This commit is contained in:
@@ -3702,6 +3702,7 @@ async fn reducer_ingests_plugin_install_suggestion_outcome_facts() {
|
||||
remote_plugin_id: Some("plugin_calendar".to_string()),
|
||||
connector_ids: vec!["connector_calendar".to_string()],
|
||||
selected: true,
|
||||
completed: true,
|
||||
},
|
||||
PluginInstallSuggestionOutcomeTool {
|
||||
tool_type: PluginInstallSuggestionToolType::Plugin,
|
||||
@@ -3709,12 +3710,12 @@ async fn reducer_ingests_plugin_install_suggestion_outcome_facts() {
|
||||
tool_name: "GitHub".to_string(),
|
||||
remote_plugin_id: None,
|
||||
connector_ids: vec!["connector_github".to_string()],
|
||||
selected: false,
|
||||
selected: true,
|
||||
completed: false,
|
||||
},
|
||||
],
|
||||
response_action: PluginInstallSuggestionResponseAction::Accept,
|
||||
user_confirmed: true,
|
||||
completed: true,
|
||||
},
|
||||
PluginInstallSuggestionOutcome {
|
||||
suggestion_id: "request_plugin_install_connector-1".to_string(),
|
||||
@@ -3726,10 +3727,10 @@ async fn reducer_ingests_plugin_install_suggestion_outcome_facts() {
|
||||
remote_plugin_id: None,
|
||||
connector_ids: vec!["connector_drive".to_string()],
|
||||
selected: false,
|
||||
completed: false,
|
||||
}],
|
||||
response_action: PluginInstallSuggestionResponseAction::Decline,
|
||||
user_confirmed: false,
|
||||
completed: false,
|
||||
},
|
||||
] {
|
||||
reducer
|
||||
@@ -3759,13 +3760,15 @@ async fn reducer_ingests_plugin_install_suggestion_outcome_facts() {
|
||||
"remote_plugin_id": "plugin_calendar",
|
||||
"connector_ids": ["connector_calendar"],
|
||||
"selected": true,
|
||||
"completed": true,
|
||||
}, {
|
||||
"tool_type": "plugin",
|
||||
"tool_id": "github@openai-curated-remote",
|
||||
"tool_name": "GitHub",
|
||||
"remote_plugin_id": null,
|
||||
"connector_ids": ["connector_github"],
|
||||
"selected": false,
|
||||
"selected": true,
|
||||
"completed": false,
|
||||
}],
|
||||
"response_action": "accept",
|
||||
"user_confirmed": true,
|
||||
@@ -3787,6 +3790,7 @@ async fn reducer_ingests_plugin_install_suggestion_outcome_facts() {
|
||||
"remote_plugin_id": null,
|
||||
"connector_ids": ["connector_drive"],
|
||||
"selected": false,
|
||||
"completed": false,
|
||||
}],
|
||||
"response_action": "decline",
|
||||
"user_confirmed": false,
|
||||
|
||||
@@ -991,6 +991,7 @@ pub(crate) struct CodexPluginInstallSuggestionOutcomeToolMetadata {
|
||||
pub(crate) remote_plugin_id: Option<String>,
|
||||
pub(crate) connector_ids: Vec<String>,
|
||||
pub(crate) selected: bool,
|
||||
pub(crate) completed: bool,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
@@ -1161,6 +1162,7 @@ pub(crate) fn codex_plugin_install_suggestion_outcome_metadata(
|
||||
tracking: &TrackEventsContext,
|
||||
outcome: PluginInstallSuggestionOutcome,
|
||||
) -> CodexPluginInstallSuggestionOutcomeMetadata {
|
||||
let completed = outcome.tools.iter().any(|tool| tool.completed);
|
||||
CodexPluginInstallSuggestionOutcomeMetadata {
|
||||
suggestion_id: outcome.suggestion_id,
|
||||
source: outcome.source,
|
||||
@@ -1174,11 +1176,12 @@ pub(crate) fn codex_plugin_install_suggestion_outcome_metadata(
|
||||
remote_plugin_id: tool.remote_plugin_id,
|
||||
connector_ids: tool.connector_ids,
|
||||
selected: tool.selected,
|
||||
completed: tool.completed,
|
||||
})
|
||||
.collect(),
|
||||
response_action: outcome.response_action,
|
||||
user_confirmed: outcome.user_confirmed,
|
||||
completed: outcome.completed,
|
||||
completed,
|
||||
thread_id: tracking.thread_id.clone(),
|
||||
turn_id: tracking.turn_id.clone(),
|
||||
model_slug: tracking.model_slug.clone(),
|
||||
|
||||
@@ -598,7 +598,6 @@ pub struct PluginInstallSuggestionOutcome {
|
||||
pub tools: Vec<PluginInstallSuggestionOutcomeTool>,
|
||||
pub response_action: PluginInstallSuggestionResponseAction,
|
||||
pub user_confirmed: bool,
|
||||
pub completed: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
@@ -609,6 +608,7 @@ pub struct PluginInstallSuggestionOutcomeTool {
|
||||
pub remote_plugin_id: Option<String>,
|
||||
pub connector_ids: Vec<String>,
|
||||
pub selected: bool,
|
||||
pub completed: bool,
|
||||
}
|
||||
|
||||
pub(crate) struct PluginInstallSuggestionOutcomeInput {
|
||||
|
||||
Reference in New Issue
Block a user