mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
[codex] stylistic changes (#29068)
## Summary - express remote compaction result handling as an exhaustive match - preserve the special `TurnAborted` path without emitting a generic compaction error - rely on the standard `test_codex` provider setup in the compaction budget test Follow-up to review feedback on #28707. ## Testing - `just test -p codex-core compaction_budget_exhaustion_aborts_without_error_or_retry` - `just fmt`
This commit is contained in:
committed by
GitHub
Unverified
parent
e0ac5d3c15
commit
802c98cab4
@@ -165,18 +165,18 @@ async fn run_remote_compact_task_inner(
|
||||
attempt
|
||||
.track(sess.as_ref(), status, codex_error, analytics_details)
|
||||
.await;
|
||||
if matches!(&result, Err(CodexErr::TurnAborted)) {
|
||||
return result;
|
||||
match result {
|
||||
Ok(()) => Ok(()),
|
||||
Err(err @ CodexErr::TurnAborted) => Err(err),
|
||||
Err(err) => {
|
||||
sess.track_turn_codex_error(turn_context, &err);
|
||||
let event = EventMsg::Error(
|
||||
err.to_error_event(Some("Error running remote compact task".to_string())),
|
||||
);
|
||||
sess.send_event(turn_context, event).await;
|
||||
Err(err)
|
||||
}
|
||||
}
|
||||
if let Err(err) = result {
|
||||
sess.track_turn_codex_error(turn_context, &err);
|
||||
let event = EventMsg::Error(
|
||||
err.to_error_event(Some("Error running remote compact task".to_string())),
|
||||
);
|
||||
sess.send_event(turn_context, event).await;
|
||||
return Err(err);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn run_remote_compact_task_inner_impl(
|
||||
|
||||
Reference in New Issue
Block a user