mirror of
https://github.com/openai/codex.git
synced 2026-10-30 19:18:49 +00:00
Attribute command and plugin analytics to the invoking model (#45445)
## Why Command execution and plugin measurement events lack model and reasoning-effort labels. Attribution needs to reflect the step that invoked the command, even when model settings change before a background process finishes. ## What changed - Add `model_slug` and `reasoning_effort` to command execution and plugin measurement analytics. - Capture model context from resolved step settings and carry it through execution, approval, Guardian review, and plugin metrics collection. - Preserve the first command-start model context when subsequent start notifications arrive. - Keep the carried context out of serialized protocol items and generated schemas. ## Testing Extend analytics tests to cover model switches before invocation and during background execution, default reasoning effort, Guardian-denied commands, and repeated start notifications retaining the original model context. GitOrigin-RevId: af90e1c0d39bab625f2e89786085b61a9b96c0ce
This commit is contained in:
@@ -188,6 +188,7 @@ pub(crate) async fn execute_user_shell_command(
|
||||
.emit_turn_item_started(
|
||||
turn_context.as_ref(),
|
||||
&TurnItem::CommandExecution(CommandExecutionItem {
|
||||
model_context: None,
|
||||
id: call_id.clone(),
|
||||
plugin_id: None,
|
||||
script_path: None,
|
||||
@@ -271,6 +272,7 @@ pub(crate) async fn execute_user_shell_command(
|
||||
.emit_turn_item_completed(
|
||||
turn_context.as_ref(),
|
||||
TurnItem::CommandExecution(CommandExecutionItem {
|
||||
model_context: None,
|
||||
id: call_id,
|
||||
plugin_id: None,
|
||||
script_path: None,
|
||||
@@ -296,6 +298,7 @@ pub(crate) async fn execute_user_shell_command(
|
||||
.emit_turn_item_completed(
|
||||
turn_context.as_ref(),
|
||||
TurnItem::CommandExecution(CommandExecutionItem {
|
||||
model_context: None,
|
||||
id: call_id.clone(),
|
||||
plugin_id: None,
|
||||
script_path: None,
|
||||
@@ -341,6 +344,7 @@ pub(crate) async fn execute_user_shell_command(
|
||||
.emit_turn_item_completed(
|
||||
turn_context.as_ref(),
|
||||
TurnItem::CommandExecution(CommandExecutionItem {
|
||||
model_context: None,
|
||||
id: call_id,
|
||||
plugin_id: None,
|
||||
script_path: None,
|
||||
|
||||
Reference in New Issue
Block a user