[codex] trace pre-sampling skill and persistence latency (#29042)

This commit is contained in:
rphilizaire-openai
2026-06-19 10:13:27 -07:00
committed by GitHub
Unverified
parent c83618ab20
commit a57b268d61
8 changed files with 49 additions and 0 deletions
+5
View File
@@ -55,6 +55,11 @@ impl InjectedHostSkillPrompts {
}
}
#[tracing::instrument(
level = "trace",
skip_all,
fields(mentioned_skill_count = mentioned_skills.len())
)]
pub async fn build_skill_injections(
mentioned_skills: &[SkillMetadata],
loaded_skills: Option<&SkillLoadOutcome>,
+9
View File
@@ -1233,6 +1233,11 @@ impl Session {
}
// Merges connector IDs into the session-level explicit connector selection.
#[tracing::instrument(
level = "trace",
skip_all,
fields(connector_count = connector_ids.len())
)]
pub(crate) async fn merge_connector_selection(
&self,
connector_ids: HashSet<String>,
@@ -1426,6 +1431,7 @@ impl Session {
state.previous_turn_settings()
}
#[tracing::instrument(level = "trace", skip_all)]
pub(crate) async fn set_previous_turn_settings(
&self,
previous_turn_settings: Option<PreviousTurnSettings>,
@@ -2736,6 +2742,7 @@ impl Session {
))
}
#[tracing::instrument(level = "trace", skip_all, fields(item_count = items.len()))]
pub(crate) async fn record_conversation_items(
&self,
turn_context: &TurnContext,
@@ -2929,6 +2936,7 @@ impl Session {
self.set_multi_agent_version_if_unset(selected)
}
#[tracing::instrument(level = "trace", skip_all, fields(item_count = items.len()))]
async fn send_raw_response_items(&self, turn_context: &TurnContext, items: &[ResponseItem]) {
for item in items {
self.send_event(
@@ -3280,6 +3288,7 @@ impl Session {
items
}
#[tracing::instrument(level = "trace", skip_all, fields(item_count = items.len()))]
pub(crate) async fn persist_rollout_items(&self, items: &[RolloutItem]) {
if let Some(live_thread) = self.live_thread()
&& let Err(e) = live_thread.append_items(items).await
+10
View File
@@ -655,6 +655,11 @@ async fn build_skills_and_plugins(
Some((injection_items, explicitly_enabled_connectors))
}
#[tracing::instrument(
level = "trace",
skip_all,
fields(user_input_count = user_input.len())
)]
async fn build_extension_turn_input_items(
sess: &Arc<Session>,
turn_context: &TurnContext,
@@ -710,6 +715,11 @@ async fn build_extension_turn_input_items(
Some(items)
}
#[tracing::instrument(
level = "trace",
skip_all,
fields(input_count = input.len())
)]
async fn track_turn_resolved_config_analytics(
sess: &Session,
turn_context: &TurnContext,
+2
View File
@@ -287,6 +287,7 @@ where
}
impl<C> SkillsExtension<C> {
#[tracing::instrument(level = "trace", skip_all)]
async fn list_skills(
&self,
mut query: SkillListQuery,
@@ -311,6 +312,7 @@ impl<C> SkillsExtension<C> {
catalog
}
#[tracing::instrument(level = "trace", skip_all, fields(skill = %entry.name))]
async fn read_main_prompt(
&self,
entry: &SkillCatalogEntry,
+5
View File
@@ -10,6 +10,11 @@ const MAX_MAIN_PROMPT_BYTES: usize = 8_000;
pub(crate) const MAX_SKILL_NAME_BYTES: usize = 256;
pub(crate) const MAX_SKILL_PATH_BYTES: usize = 1_024;
#[tracing::instrument(
level = "trace",
skip_all,
fields(catalog_entry_count = catalog.entries.len())
)]
pub(crate) fn available_skills_fragment(
catalog: &SkillCatalog,
) -> Option<AvailableSkillsInstructions> {
+8
View File
@@ -10,6 +10,14 @@ use crate::catalog::SkillPackageId;
const SKILL_PATH_PREFIX: &str = "skill://";
#[tracing::instrument(
level = "trace",
skip_all,
fields(
input_count = inputs.len(),
catalog_entry_count = catalog.entries.len()
)
)]
pub(crate) fn collect_explicit_skill_mentions(
inputs: &[UserInput],
catalog: &SkillCatalog,
+5
View File
@@ -133,6 +133,11 @@ impl LiveThread {
})
}
#[tracing::instrument(
level = "trace",
skip_all,
fields(item_count = items.len())
)]
pub async fn append_items(&self, items: &[RolloutItem]) -> ThreadStoreResult<()> {
let canonical_items = persisted_rollout_items(items);
if items.is_empty() {
@@ -74,6 +74,11 @@ pub(super) async fn resume_thread(
store.insert_live_recorder(params.thread_id, recorder).await
}
#[tracing::instrument(
level = "trace",
skip_all,
fields(item_count = params.items.len())
)]
pub(super) async fn append_items(
store: &LocalThreadStore,
params: AppendThreadItemsParams,