mirror of
https://github.com/openai/codex.git
synced 2026-11-07 20:30:33 +00:00
Collect plugin metrics from remote executors (#38283)
## What changed - Resolve manifest-declared metric operations against the executor filesystem for remote plugin commands. - Create the measurement sidecar in an executor-native, owner-private temporary directory, stream its bounded output back for validation, and clean up the directory afterward. - Extend the exec-server protocol with the executor temporary directory and atomic private-directory creation. ## Testing - Cover remote unified-exec measurements for foreground and background commands. - Verify private directories use owner-only permissions on Unix and fail closed on unsupported platforms. GitOrigin-RevId: dbbd0a84717b91237fc5728e510e18994eb46dd4
This commit is contained in:
@@ -216,7 +216,8 @@ pub(crate) fn spawn_exit_watcher(
|
||||
&session_ref,
|
||||
&turn_ref,
|
||||
&call_id,
|
||||
);
|
||||
)
|
||||
.await;
|
||||
emit_exec_end_for_unified_exec(
|
||||
session_ref,
|
||||
turn_ref,
|
||||
|
||||
@@ -251,14 +251,15 @@ struct InitialExecCommandGuard {
|
||||
}
|
||||
|
||||
impl InitialExecCommandGuard {
|
||||
fn finish_plugin_metrics(&mut self, context: &UnifiedExecContext, exit_code: i32) {
|
||||
async fn finish_plugin_metrics(&mut self, context: &UnifiedExecContext, exit_code: i32) {
|
||||
finish_and_track_measurements(
|
||||
self.metrics_sidecar.take(),
|
||||
exit_code,
|
||||
&context.session,
|
||||
&context.step_context.turn,
|
||||
&context.call_id,
|
||||
);
|
||||
)
|
||||
.await;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -661,7 +662,8 @@ impl UnifiedExecProcessManager {
|
||||
&context.session,
|
||||
&context.step_context.turn,
|
||||
&context.call_id,
|
||||
);
|
||||
)
|
||||
.await;
|
||||
(None, exit_code)
|
||||
}
|
||||
ProcessStatus::Unknown => {
|
||||
@@ -694,7 +696,9 @@ impl UnifiedExecProcessManager {
|
||||
}
|
||||
let exit_code = process.exit_code();
|
||||
let exit = exit_code.unwrap_or(-1);
|
||||
initial_exec_command_guard.finish_plugin_metrics(context, exit);
|
||||
initial_exec_command_guard
|
||||
.finish_plugin_metrics(context, exit)
|
||||
.await;
|
||||
emit_exec_end_for_unified_exec(
|
||||
Arc::clone(&context.session),
|
||||
Arc::clone(&context.step_context.turn),
|
||||
|
||||
Reference in New Issue
Block a user