Track built-in control tool calls in analytics (#39510)

## What changed

- Emit `codex_control_tool_call_event` for built-in control tools such as
  `request_user_input`, `update_plan`, `view_image`, and goal tools.
- Record correlation and timing metadata plus completed, failed, rejected, or
  interrupted outcomes, and include these calls in turn-level tool counts.
- Keep tool arguments out of control-tool analytics events.

## Testing

- Extend the app-server turn profile test to cover successful and failed
  control tools, event correlation, turn counts, and argument exclusion.

GitOrigin-RevId: c20f73dfb79654e31b4b5040eddb0e0d91cae10d
This commit is contained in:
jif authored and copyberry committed 2026-08-19 15:55:38 +00:00
1 parent 6972c57c78
commit 992f5c681f
13 files changed
+343 -9

No files matched your search

+6
View File
@@ -336,6 +336,12 @@ impl AnalyticsEventsClient {
));
}
pub fn track_control_tool_call(&self, input: crate::facts::ControlToolCallFact) {
self.record_fact(AnalyticsFact::Custom(CustomAnalyticsFact::ControlToolCall(
input,
)));
}
pub fn track_guardian_review(
&self,
tracking: &GuardianReviewTrackContext,