mirror of
https://github.com/openai/codex.git
synced 2026-11-13 21:30:47 +00:00
Upgrade the Rust toolchain to 1.99.1 (#61205)
## What changed - Update the workspace, Bazel toolchain and lockfile, CI and release workflows, and Windows setup script from Rust `1.95.0` to `1.99.1`. - Adapt Rust code to the updated toolchain and Clippy lints, including `try_update` for atomics, `as_chunks` for fixed-size slices, and targeted allowances for generated tonic services. - Refresh the halfwidth sound mark rendering snapshot to use literal characters in debug output. GitOrigin-RevId: 5852029f687436dc814c2bca68141ee1f4a67d49
This commit is contained in:
@@ -276,10 +276,13 @@ pub enum ExecPolicyUpdateError {
|
||||
JoinBlockingTask { source: tokio::task::JoinError },
|
||||
|
||||
#[error("failed to update in-memory rules: {source}")]
|
||||
AddRule {
|
||||
#[from]
|
||||
source: ExecPolicyRuleError,
|
||||
},
|
||||
AddRule { source: ExecPolicyRuleError },
|
||||
}
|
||||
|
||||
impl From<ExecPolicyRuleError> for ExecPolicyUpdateError {
|
||||
fn from(source: ExecPolicyRuleError) -> Self {
|
||||
Self::AddRule { source }
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) struct ExecPolicyManager {
|
||||
|
||||
@@ -367,14 +367,14 @@ impl RealtimeStreamedItem {
|
||||
if self.buffered_text.is_empty() {
|
||||
return None;
|
||||
}
|
||||
let text = self.buffered_text.drain(..).collect::<String>();
|
||||
let text = std::mem::take(&mut self.buffered_text);
|
||||
let text = format!("{prefix}{text}");
|
||||
self.sent_bytes += text.len();
|
||||
return Some(text);
|
||||
}
|
||||
|
||||
let head = self.buffered_text.drain(..).collect::<String>();
|
||||
let tail = self.tail_text.drain(..).collect::<String>();
|
||||
let head = std::mem::take(&mut self.buffered_text);
|
||||
let tail = std::mem::take(&mut self.tail_text);
|
||||
let text = format!("{prefix}{head}{HANDOFF_STREAM_TRUNCATION_MARKER}{tail}");
|
||||
self.sent_bytes += text.len();
|
||||
Some(text)
|
||||
|
||||
@@ -398,7 +398,7 @@ impl ExecutedToolCalls {
|
||||
fn reserve_direct_call(&self) -> Option<DirectCallPermit> {
|
||||
let recording = Arc::downgrade(&self.lock_state().as_ref()?.recording);
|
||||
self.pending_direct_calls
|
||||
.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |pending| {
|
||||
.try_update(Ordering::Relaxed, Ordering::Relaxed, |pending| {
|
||||
(pending < MAX_PENDING_EXECUTED_TOOL_CALLS).then_some(pending + 1)
|
||||
})
|
||||
.ok()?;
|
||||
|
||||
@@ -565,7 +565,7 @@ impl Respond for CodexAppsJsonRpcResponder {
|
||||
.as_ref()
|
||||
.is_some_and(|remaining| {
|
||||
remaining
|
||||
.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |remaining| {
|
||||
.try_update(Ordering::SeqCst, Ordering::SeqCst, |remaining| {
|
||||
remaining.checked_sub(1)
|
||||
})
|
||||
.is_ok()
|
||||
|
||||
@@ -4008,7 +4008,8 @@ async fn astra_async_compaction_keeps_work_added_after_its_snapshot(
|
||||
)
|
||||
.await?;
|
||||
assert_eq!(compaction_events.len(), if over_budget { 4 } else { 2 });
|
||||
for pair in compaction_events.chunks_exact(2) {
|
||||
const EVENTS_PER_COMPACTION: usize = 2;
|
||||
for pair in compaction_events.as_chunks::<EVENTS_PER_COMPACTION>().0 {
|
||||
assert_eq!((pair[0].0, pair[1].0), ("started", "completed"));
|
||||
assert_eq!(pair[0].1, pair[1].1);
|
||||
}
|
||||
|
||||
@@ -688,7 +688,7 @@ async fn sandbox_denied_exec_command_returns_original_output() -> Result<()> {
|
||||
"printf {sentinel:?} >&2; printf {content:?} > {path:?}",
|
||||
sentinel = format!("{sentinel}\n"),
|
||||
content = "sandbox denied",
|
||||
path = &target_path
|
||||
path = target_path
|
||||
);
|
||||
let args = json!({
|
||||
"cmd": command,
|
||||
|
||||
Reference in New Issue
Block a user