mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
adding parent_thread_id in guardian (#17249)
## Summary This PR adds the parent conversation/session id to the subagent-start analytics event for Guardian subagents. Previously, Guardian sessions were emitted as subagent thread-initialized events, but their `parent_thread_id` was serialized as `null`. After this change, the `codex_thread_initialized` analytics event for a Guardian child session includes the parent user conversation id.
This commit is contained in:
committed by
GitHub
Unverified
parent
26a28afc6d
commit
4e910bf151
@@ -283,6 +283,7 @@ impl AgentControl {
|
||||
.analytics_events_client,
|
||||
client_metadata,
|
||||
new_thread.thread_id,
|
||||
/*parent_thread_id*/ None,
|
||||
thread_config,
|
||||
subagent_source.clone(),
|
||||
);
|
||||
|
||||
@@ -4582,6 +4582,7 @@ pub(crate) fn emit_subagent_session_started(
|
||||
analytics_events_client: &AnalyticsEventsClient,
|
||||
client_metadata: AppServerClientMetadata,
|
||||
thread_id: ThreadId,
|
||||
parent_thread_id: Option<ThreadId>,
|
||||
thread_config: ThreadConfigSnapshot,
|
||||
subagent_source: SubAgentSource,
|
||||
) {
|
||||
@@ -4599,6 +4600,7 @@ pub(crate) fn emit_subagent_session_started(
|
||||
.as_secs();
|
||||
analytics_events_client.track_subagent_thread_started(SubAgentThreadStartedInput {
|
||||
thread_id: thread_id.to_string(),
|
||||
parent_thread_id: parent_thread_id.map(|thread_id| thread_id.to_string()),
|
||||
product_client_id: client_name.clone(),
|
||||
client_name,
|
||||
client_version,
|
||||
|
||||
@@ -104,6 +104,7 @@ pub(crate) async fn run_codex_thread_interactive(
|
||||
&parent_session.services.analytics_events_client,
|
||||
client_metadata,
|
||||
codex.session.conversation_id,
|
||||
Some(parent_session.conversation_id),
|
||||
thread_config,
|
||||
subagent_source,
|
||||
);
|
||||
|
||||
@@ -156,6 +156,7 @@ pub(super) async fn run(session: &Arc<Session>, config: Arc<Config>) {
|
||||
&session.services.analytics_events_client,
|
||||
client_metadata,
|
||||
thread_id,
|
||||
/*parent_thread_id*/ None,
|
||||
thread_config,
|
||||
SubAgentSource::MemoryConsolidation,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user