mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
rename
This commit is contained in:
@@ -39,12 +39,12 @@ pub(crate) struct SkillInvocation {
|
||||
pub(crate) skill_name: String,
|
||||
pub(crate) skill_scope: SkillScope,
|
||||
pub(crate) skill_path: PathBuf,
|
||||
pub(crate) invoke_type: InvokeType,
|
||||
pub(crate) invocation_type: InvocationType,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Serialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub(crate) enum InvokeType {
|
||||
pub(crate) enum InvocationType {
|
||||
Explicit,
|
||||
Implicit,
|
||||
}
|
||||
@@ -52,7 +52,7 @@ pub(crate) enum InvokeType {
|
||||
pub(crate) struct AppInvocation {
|
||||
pub(crate) connector_id: Option<String>,
|
||||
pub(crate) app_name: Option<String>,
|
||||
pub(crate) invoke_type: Option<InvokeType>,
|
||||
pub(crate) invocation_type: Option<InvocationType>,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
@@ -206,7 +206,8 @@ struct SkillInvocationEventParams {
|
||||
skill_scope: Option<String>,
|
||||
repo_url: Option<String>,
|
||||
thread_id: Option<String>,
|
||||
invoke_type: Option<InvokeType>,
|
||||
#[serde(rename = "invoke_type")]
|
||||
invocation_type: Option<InvocationType>,
|
||||
model_slug: Option<String>,
|
||||
}
|
||||
|
||||
@@ -217,7 +218,8 @@ struct CodexAppMetadata {
|
||||
turn_id: Option<String>,
|
||||
app_name: Option<String>,
|
||||
product_client_id: Option<String>,
|
||||
invoke_type: Option<InvokeType>,
|
||||
#[serde(rename = "invoke_type")]
|
||||
invocation_type: Option<InvocationType>,
|
||||
model_slug: Option<String>,
|
||||
}
|
||||
|
||||
@@ -337,7 +339,7 @@ async fn send_track_skill_invocations(auth_manager: &AuthManager, job: TrackSkil
|
||||
skill_name: invocation.skill_name.clone(),
|
||||
event_params: SkillInvocationEventParams {
|
||||
thread_id: Some(tracking.thread_id.clone()),
|
||||
invoke_type: Some(invocation.invoke_type),
|
||||
invocation_type: Some(invocation.invocation_type),
|
||||
model_slug: Some(tracking.model_slug.clone()),
|
||||
product_client_id: Some(crate::default_client::originator().value),
|
||||
repo_url,
|
||||
@@ -392,7 +394,7 @@ fn codex_app_metadata(tracking: &TrackEventsContext, app: AppInvocation) -> Code
|
||||
turn_id: Some(tracking.turn_id.clone()),
|
||||
app_name: app.app_name,
|
||||
product_client_id: Some(crate::default_client::originator().value),
|
||||
invoke_type: app.invoke_type,
|
||||
invocation_type: app.invocation_type,
|
||||
model_slug: Some(tracking.model_slug.clone()),
|
||||
}
|
||||
}
|
||||
@@ -494,7 +496,7 @@ mod tests {
|
||||
use super::AppInvocation;
|
||||
use super::CodexAppMentionedEventRequest;
|
||||
use super::CodexAppUsedEventRequest;
|
||||
use super::InvokeType;
|
||||
use super::InvocationType;
|
||||
use super::TrackEventRequest;
|
||||
use super::TrackEventsContext;
|
||||
use super::codex_app_metadata;
|
||||
@@ -577,7 +579,7 @@ mod tests {
|
||||
AppInvocation {
|
||||
connector_id: Some("calendar".to_string()),
|
||||
app_name: Some("Calendar".to_string()),
|
||||
invoke_type: Some(InvokeType::Explicit),
|
||||
invocation_type: Some(InvocationType::Explicit),
|
||||
},
|
||||
),
|
||||
});
|
||||
@@ -615,7 +617,7 @@ mod tests {
|
||||
AppInvocation {
|
||||
connector_id: Some("drive".to_string()),
|
||||
app_name: Some("Google Drive".to_string()),
|
||||
invoke_type: Some(InvokeType::Implicit),
|
||||
invocation_type: Some(InvocationType::Implicit),
|
||||
},
|
||||
),
|
||||
});
|
||||
@@ -649,7 +651,7 @@ mod tests {
|
||||
let app = AppInvocation {
|
||||
connector_id: Some("calendar".to_string()),
|
||||
app_name: Some("Calendar".to_string()),
|
||||
invoke_type: Some(InvokeType::Implicit),
|
||||
invocation_type: Some(InvocationType::Implicit),
|
||||
};
|
||||
|
||||
let turn_1 = TrackEventsContext {
|
||||
|
||||
@@ -15,7 +15,7 @@ use crate::agent::MAX_THREAD_SPAWN_DEPTH;
|
||||
use crate::agent::agent_status_from_event;
|
||||
use crate::analytics_client::AnalyticsEventsClient;
|
||||
use crate::analytics_client::AppInvocation;
|
||||
use crate::analytics_client::InvokeType;
|
||||
use crate::analytics_client::InvocationType;
|
||||
use crate::analytics_client::build_track_events_context;
|
||||
use crate::apps::render_apps_section;
|
||||
use crate::commit_attribution::commit_message_trailer_instruction;
|
||||
@@ -4367,7 +4367,7 @@ pub(crate) async fn run_turn(
|
||||
app_name: connector_names_by_id
|
||||
.get(connector_id.as_str())
|
||||
.map(|name| (*name).to_string()),
|
||||
invoke_type: Some(InvokeType::Explicit),
|
||||
invocation_type: Some(InvocationType::Explicit),
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
sess.services
|
||||
|
||||
@@ -4,7 +4,7 @@ use std::time::Instant;
|
||||
use tracing::error;
|
||||
|
||||
use crate::analytics_client::AppInvocation;
|
||||
use crate::analytics_client::InvokeType;
|
||||
use crate::analytics_client::InvocationType;
|
||||
use crate::analytics_client::build_track_events_context;
|
||||
use crate::codex::Session;
|
||||
use crate::codex::TurnContext;
|
||||
@@ -233,15 +233,15 @@ async fn maybe_track_codex_app_used(
|
||||
let (connector_id, app_name) = metadata
|
||||
.map(|metadata| (metadata.connector_id, metadata.app_name))
|
||||
.unwrap_or((None, None));
|
||||
let invoke_type = if let Some(connector_id) = connector_id.as_deref() {
|
||||
let invocation_type = if let Some(connector_id) = connector_id.as_deref() {
|
||||
let mentioned_connector_ids = sess.get_connector_selection().await;
|
||||
if mentioned_connector_ids.contains(connector_id) {
|
||||
InvokeType::Explicit
|
||||
InvocationType::Explicit
|
||||
} else {
|
||||
InvokeType::Implicit
|
||||
InvocationType::Implicit
|
||||
}
|
||||
} else {
|
||||
InvokeType::Implicit
|
||||
InvocationType::Implicit
|
||||
};
|
||||
|
||||
let tracking = build_track_events_context(
|
||||
@@ -254,7 +254,7 @@ async fn maybe_track_codex_app_used(
|
||||
AppInvocation {
|
||||
connector_id,
|
||||
app_name,
|
||||
invoke_type: Some(invoke_type),
|
||||
invocation_type: Some(invocation_type),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ use std::collections::HashSet;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::analytics_client::AnalyticsEventsClient;
|
||||
use crate::analytics_client::InvokeType;
|
||||
use crate::analytics_client::InvocationType;
|
||||
use crate::analytics_client::SkillInvocation;
|
||||
use crate::analytics_client::TrackEventsContext;
|
||||
use crate::instructions::SkillInstructions;
|
||||
@@ -44,7 +44,7 @@ pub(crate) async fn build_skill_injections(
|
||||
skill_name: skill.name.clone(),
|
||||
skill_scope: skill.scope,
|
||||
skill_path: skill.path.clone(),
|
||||
invoke_type: InvokeType::Explicit,
|
||||
invocation_type: InvocationType::Explicit,
|
||||
});
|
||||
result.items.push(ResponseItem::from(SkillInstructions {
|
||||
name: skill.name.clone(),
|
||||
|
||||
@@ -10,7 +10,7 @@ use codex_protocol::items::TurnItem;
|
||||
use serde::Deserialize;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
use crate::analytics_client::InvokeType;
|
||||
use crate::analytics_client::InvocationType;
|
||||
use crate::analytics_client::SkillInvocation;
|
||||
use crate::analytics_client::TrackEventsContext;
|
||||
use crate::analytics_client::skill_id_for_local_skill;
|
||||
@@ -91,7 +91,7 @@ pub(crate) async fn build_implicit_invocation_context(
|
||||
skill_name: skill.name,
|
||||
skill_scope: skill.scope,
|
||||
skill_path: skill.path,
|
||||
invoke_type: InvokeType::Implicit,
|
||||
invocation_type: InvocationType::Implicit,
|
||||
};
|
||||
let repo_root = get_git_repo_root(invocation.skill_path.as_path());
|
||||
let repo_url = if let Some(root) = repo_root.as_ref() {
|
||||
@@ -540,7 +540,7 @@ pub(crate) fn response_input_to_response_item(input: &ResponseInputItem) -> Opti
|
||||
mod tests {
|
||||
use super::ImplicitSkillCandidate;
|
||||
use super::ImplicitSkillDetector;
|
||||
use super::InvokeType;
|
||||
use super::InvocationType;
|
||||
use super::SkillInvocation;
|
||||
use super::detect_skill_doc_read;
|
||||
use super::detect_skill_script_run;
|
||||
@@ -581,7 +581,7 @@ mod tests {
|
||||
skill_name: "test-skill".to_string(),
|
||||
skill_scope: codex_protocol::protocol::SkillScope::User,
|
||||
skill_path: skill_doc_path,
|
||||
invoke_type: InvokeType::Implicit,
|
||||
invocation_type: InvocationType::Implicit,
|
||||
};
|
||||
let candidate = ImplicitSkillCandidate {
|
||||
invocation,
|
||||
@@ -615,7 +615,7 @@ mod tests {
|
||||
skill_name: "test-skill".to_string(),
|
||||
skill_scope: codex_protocol::protocol::SkillScope::User,
|
||||
skill_path: skill_doc_path,
|
||||
invoke_type: InvokeType::Implicit,
|
||||
invocation_type: InvocationType::Implicit,
|
||||
};
|
||||
let candidate = ImplicitSkillCandidate {
|
||||
invocation,
|
||||
@@ -647,7 +647,7 @@ mod tests {
|
||||
skill_name: "test-skill".to_string(),
|
||||
skill_scope: codex_protocol::protocol::SkillScope::User,
|
||||
skill_path: skill_doc_path,
|
||||
invoke_type: InvokeType::Implicit,
|
||||
invocation_type: InvocationType::Implicit,
|
||||
};
|
||||
let candidate = ImplicitSkillCandidate {
|
||||
invocation,
|
||||
|
||||
Reference in New Issue
Block a user