Merge origin/main into rhan/surface-updates and resolve guardian tests conflict

This commit is contained in:
Roy Han
2026-03-16 17:42:39 -07:00
1516 changed files with 150231 additions and 6961 deletions
+2 -2
View File
@@ -32,14 +32,14 @@ impl SessionTask for CompactTask {
let _ = if crate::compact::should_use_remote_compact_task(&ctx.provider) {
let _ = session.services.session_telemetry.counter(
"codex.task.compact",
1,
/*inc*/ 1,
&[("type", "remote")],
);
crate::compact_remote::run_remote_compact_task(session.clone(), ctx).await
} else {
let _ = session.services.session_telemetry.counter(
"codex.task.compact",
1,
/*inc*/ 1,
&[("type", "local")],
);
crate::compact::run_compact_task(session.clone(), ctx, input).await
+6 -4
View File
@@ -56,7 +56,7 @@ pub(crate) use user_shell::UserShellCommandTask;
pub(crate) use user_shell::execute_user_shell_command;
const GRACEFULL_INTERRUPTION_TIMEOUT_MS: u64 = 100;
const TURN_ABORTED_INTERRUPTED_GUIDANCE: &str = "The user interrupted the previous turn on purpose. Any running unified exec processes were terminated. If any tools/commands were aborted, they may have partially executed; verify current state before retrying.";
const TURN_ABORTED_INTERRUPTED_GUIDANCE: &str = "The user interrupted the previous turn on purpose. Any running unified exec processes may still be running in the background. If any tools/commands were aborted, they may have partially executed; verify current state before retrying.";
fn emit_turn_network_proxy_metric(
session_telemetry: &SessionTelemetry,
@@ -68,7 +68,11 @@ fn emit_turn_network_proxy_metric(
} else {
"false"
};
session_telemetry.counter(TURN_NETWORK_PROXY_METRIC, 1, &[("active", active), tmp_mem]);
session_telemetry.counter(
TURN_NETWORK_PROXY_METRIC,
/*inc*/ 1,
&[("active", active), tmp_mem],
);
}
/// Thin wrapper that exposes the parts of [`Session`] task runners need.
@@ -394,8 +398,6 @@ impl Session {
}
pub(crate) async fn cleanup_after_interrupt(&self, turn_context: &Arc<TurnContext>) {
self.close_unified_exec_processes().await;
if let Some(manager) = turn_context.js_repl.manager_if_initialized()
&& let Err(err) = manager.interrupt_turn_exec(&turn_context.sub_id).await
{
+1 -1
View File
@@ -81,7 +81,7 @@ impl SessionTask for RegularTask {
) -> Option<String> {
let sess = session.clone_session();
let run_turn_span = trace_span!("run_turn");
sess.set_server_reasoning_included(false).await;
sess.set_server_reasoning_included(/*included*/ false).await;
let prewarmed_client_session = self.take_prewarmed_session().await;
run_turn(
sess,
+9 -9
View File
@@ -55,11 +55,11 @@ impl SessionTask for ReviewTask {
input: Vec<UserInput>,
cancellation_token: CancellationToken,
) -> Option<String> {
let _ = session
.session
.services
.session_telemetry
.counter("codex.task.review", 1, &[]);
let _ = session.session.services.session_telemetry.counter(
"codex.task.review",
/*inc*/ 1,
&[],
);
// Start sub-codex conversation and get the receiver for events.
let output = match start_review_conversation(
@@ -80,7 +80,7 @@ impl SessionTask for ReviewTask {
}
async fn abort(&self, session: Arc<SessionTaskContext>, ctx: Arc<TurnContext>) {
exit_review_mode(session.clone_session(), None, ctx).await;
exit_review_mode(session.clone_session(), /*review_output*/ None, ctx).await;
}
}
@@ -121,8 +121,8 @@ async fn start_review_conversation(
ctx.clone(),
cancellation_token,
SubAgentSource::Review,
None,
None,
/*final_output_json_schema*/ None,
/*initial_history*/ None,
)
.await)
.ok()
@@ -217,7 +217,7 @@ pub(crate) async fn exit_review_mode(
findings_str.push_str(text);
}
if !out.findings.is_empty() {
let block = format_review_findings_block(&out.findings, None);
let block = format_review_findings_block(&out.findings, /*selection*/ None);
findings_str.push_str(&format!("\n{block}"));
}
let rendered =
+5 -5
View File
@@ -42,11 +42,11 @@ impl SessionTask for UndoTask {
_input: Vec<UserInput>,
cancellation_token: CancellationToken,
) -> Option<String> {
let _ = session
.session
.services
.session_telemetry
.counter("codex.task.undo", 1, &[]);
let _ = session.session.services.session_telemetry.counter(
"codex.task.undo",
/*inc*/ 1,
&[],
);
let sess = session.clone_session();
sess.send_event(
ctx.as_ref(),
+9 -4
View File
@@ -101,7 +101,7 @@ pub(crate) async fn execute_user_shell_command(
session
.services
.session_telemetry
.counter("codex.task.user_shell", 1, &[]);
.counter("codex.task.user_shell", /*inc*/ 1, &[]);
if mode == UserShellCommandMode::StandaloneTurn {
// Auxiliary mode runs within an existing active turn. That turn already
@@ -185,9 +185,14 @@ pub(crate) async fn execute_user_shell_command(
tx_event: session.get_tx_event(),
});
let exec_result = execute_exec_request(exec_env, &sandbox_policy, stdout_stream, None)
.or_cancel(&cancellation_token)
.await;
let exec_result = execute_exec_request(
exec_env,
&sandbox_policy,
stdout_stream,
/*after_spawn*/ None,
)
.or_cancel(&cancellation_token)
.await;
match exec_result {
Err(CancelErr::Cancelled) => {