Upgrade the Rust toolchain to 1.99.1 (#55677)

## What changed

- Update Cargo and Bazel toolchain pins, CI and release workflows, and Windows setup from Rust `1.95.0` to `1.99.1`.
- Adapt Rust code to updated APIs and lint requirements, including `try_update` and `as_chunks`, and refresh the halfwidth sound marks snapshot.
- Update `webpki-root-certs` from `1.0.5` to `1.0.10` in the Cargo and Bazel lockfiles.

GitOrigin-RevId: e1aaed63b7e72bb8c8bbe25b32c6329c9a37b6c3
This commit is contained in:
Dmitriy Kovalenko
2026-10-20 21:28:45 +00:00
committed by copyberry
parent c465563aa9
commit ef1604d8f5
52 changed files with 225 additions and 213 deletions
@@ -18,7 +18,7 @@ runs:
cache-scope: bazel-release
- name: Install Cargo for workspace metadata
uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8 # 1.99.1
- name: Configure MSVC environment
if: ${{ runner.os == 'Windows' }}
@@ -39,7 +39,7 @@ runs:
*) echo "Unsupported build mode: $BUILD_MODE" >&2; exit 1 ;;
esac
- uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
- uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8 # 1.99.1
with:
targets: ${{ inputs.target }}
+2 -2
View File
@@ -18,12 +18,12 @@ jobs:
- uses: ./.github/actions/setup-ci
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8 # 1.99.1
- name: Run cargo-deny
uses: EmbarkStudios/cargo-deny-action@82eb9f621fbc699dd0918f3ea06864c14cc84246 # v2
with:
rust-version: 1.95.0
rust-version: 1.99.1
manifest-path: ./codex-rs/Cargo.toml
- name: Check for a clean worktree
@@ -85,7 +85,7 @@ jobs:
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends build-essential pkg-config libcap-dev libasound2-dev bubblewrap
fi
- uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
- uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8 # 1.99.1
with:
targets: ${{ inputs.target }}
@@ -300,7 +300,7 @@ jobs:
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends pkg-config libcap-dev libasound2-dev bubblewrap
fi
- uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
- uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8 # 1.99.1
with:
targets: ${{ inputs.target }}
+3 -3
View File
@@ -21,7 +21,7 @@ jobs:
with:
persist-credentials: false
- uses: ./.github/actions/setup-ci
- uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
- uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8 # 1.99.1
with:
components: rustfmt
- name: cargo fmt
@@ -40,7 +40,7 @@ jobs:
with:
persist-credentials: false
- uses: ./.github/actions/setup-ci
- uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
- uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8 # 1.99.1
- uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2.62.49
with:
tool: cargo-shear@1.11.2
@@ -228,7 +228,7 @@ jobs:
sudo apt-get update -y
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends build-essential pkg-config libcap-dev libasound2-dev
fi
- uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
- uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8 # 1.99.1
with:
targets: ${{ matrix.target }}
components: clippy
+3 -3
View File
@@ -70,7 +70,7 @@ jobs:
with:
persist-credentials: false
- uses: ./.github/actions/setup-ci
- uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
- uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8 # 1.99.1
with:
components: rustfmt
- name: cargo fmt
@@ -95,7 +95,7 @@ jobs:
with:
persist-credentials: false
- uses: ./.github/actions/setup-ci
- uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
- uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8 # 1.99.1
- uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2.62.49
with:
tool: cargo-shear@1.11.2
@@ -119,7 +119,7 @@ jobs:
with:
persist-credentials: false
- uses: ./.github/actions/setup-ci
- uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
- uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8 # 1.99.1
- name: Install nightly argument-comment-lint toolchain
shell: bash
run: |
+1 -1
View File
@@ -100,7 +100,7 @@ jobs:
Write-Host "Disk usage:"
Get-PSDrive -PSProvider FileSystem | Format-Table -AutoSize Name, @{Name='Size(GB)';Expression={[math]::Round(($_.Used + $_.Free) / 1GB, 1)}}, @{Name='Free(GB)';Expression={[math]::Round($_.Free / 1GB, 1)}}
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8 # 1.99.1
with:
targets: ${{ matrix.build-system == 'cargo' && matrix.target || '' }}
+2 -2
View File
@@ -30,7 +30,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
- uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8 # 1.99.1
- name: Validate tag matches Cargo.toml version
shell: bash
run: |
@@ -183,7 +183,7 @@ jobs:
sudo apt-get update -y
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends binutils pkg-config libcap-dev
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8 # 1.99.1
with:
targets: ${{ matrix.build-system == 'cargo' && matrix.target || '' }}
+5 -5
View File
@@ -173,9 +173,9 @@ jobs:
python-version: "3.12"
- name: Set up Rust toolchain for Cargo smoke
uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8 # 1.99.1
with:
toolchain: "1.95.0"
toolchain: "1.99.1"
- name: Build Bazel V8 release pair
env:
@@ -336,9 +336,9 @@ jobs:
architecture: x64
- name: Set up Codex Rust toolchain for Cargo smoke
uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8 # 1.99.1
with:
toolchain: "1.95.0"
toolchain: "1.99.1"
targets: ${{ matrix.target }}
- name: Install rusty_v8 Rust toolchain
@@ -428,7 +428,7 @@ jobs:
cd codex-rs
RUSTY_V8_ARCHIVE="${GITHUB_WORKSPACE}/${archive}" \
RUSTY_V8_SRC_BINDING_PATH="${GITHUB_WORKSPACE}/${binding}" \
cargo +1.95.0 test -p codex-v8-poc --target "${TARGET}" --features sandbox --no-run
cargo +1.99.1 test -p codex-v8-poc --target "${TARGET}" --features sandbox --no-run
)
- name: Upload staged artifacts
+5 -5
View File
@@ -186,9 +186,9 @@ jobs:
python-version: "3.12"
- name: Set up Rust toolchain for Cargo smoke
uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8 # 1.99.1
with:
toolchain: "1.95.0"
toolchain: "1.99.1"
- name: Build Bazel V8 release pair
env:
@@ -354,9 +354,9 @@ jobs:
architecture: x64
- name: Set up Codex Rust toolchain for Cargo smoke
uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8 # 1.99.1
with:
toolchain: "1.95.0"
toolchain: "1.99.1"
targets: ${{ matrix.target }}
- name: Install rusty_v8 Rust toolchain
@@ -446,7 +446,7 @@ jobs:
cd codex-rs
RUSTY_V8_ARCHIVE="${GITHUB_WORKSPACE}/${archive}" \
RUSTY_V8_SRC_BINDING_PATH="${GITHUB_WORKSPACE}/${binding}" \
cargo +1.95.0 test -p codex-v8-poc --target "${TARGET}" --features sandbox --no-run
cargo +1.99.1 test -p codex-v8-poc --target "${TARGET}" --features sandbox --no-run
)
- name: Upload staged artifacts
+1 -1
View File
@@ -325,7 +325,7 @@ toolchains.toolchain(
edition = "2024",
extra_exec_rustc_flags = MSVC_RUSTC_FLAGS,
extra_rustc_flags = MSVC_RUSTC_FLAGS,
version = "1.95.0",
version = "1.99.1",
)
use_repo(toolchains, "default_rust_toolchains")
+102 -102
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -16783,9 +16783,9 @@ dependencies = [
[[package]]
name = "webpki-root-certs"
version = "1.0.5"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36a29fc0408b113f68cf32637857ab740edfafdf460c326cd2afaa2d84cc05dc"
checksum = "58ec80e73fd8baf57bf0d9615554c75348bda990d6d5bbeab964dd068319fecb"
dependencies = [
"rustls-pki-types",
]
-1
View File
@@ -564,7 +564,6 @@ fn signing_key_from_private_key_pkcs8_base64(private_key_pkcs8_base64: &str) ->
#[cfg(test)]
mod tests {
use base64::Engine as _;
use ed25519_dalek::Signature;
use ed25519_dalek::Verifier as _;
use jsonwebtoken::EncodingKey;
+3 -3
View File
@@ -1234,7 +1234,7 @@ impl MessageProcessor {
.clients_revoke(params)
.await
.map(|response| Some(response.into())),
ClientRequest::ConfigRequirementsRead { params: _, .. } => self
ClientRequest::ConfigRequirementsRead { .. } => self
.config_processor
.config_requirements_read()
.await
@@ -1293,7 +1293,7 @@ impl MessageProcessor {
.unwatch(connection_id, params)
.await
.map(|response| Some(response.into())),
ClientRequest::ModelProviderCapabilitiesRead { params: _, .. } => self
ClientRequest::ModelProviderCapabilitiesRead { .. } => self
.config_processor
.model_provider_capabilities_read()
.await
@@ -1728,7 +1728,7 @@ impl MessageProcessor {
ClientRequest::ThreadTimelineList { params, .. } => {
self.thread_processor.thread_timeline_list(params).await
}
ClientRequest::ThreadRealtimeListVoices { params: _, .. } => {
ClientRequest::ThreadRealtimeListVoices { .. } => {
self.turn_processor.thread_realtime_list_voices().await
}
ClientRequest::ReviewStart { params, .. } => {
@@ -1,3 +1,5 @@
#![allow(clippy::double_must_use)] // Emitted by async_trait in the generated tonic service.
#[cfg(codex_bazel)]
pub use code_mode_proto::codex::code_mode::v1::*;
@@ -153,7 +153,7 @@ impl SessionRuntime {
fn allocate_cell_id(&self) -> Result<CellId, Error> {
self.inner
.next_cell_id
.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |next_cell_id| {
.try_update(Ordering::Relaxed, Ordering::Relaxed, |next_cell_id| {
next_cell_id.checked_add(1)
})
.map(|cell_id| CellId::new(cell_id.to_string()))
@@ -42,13 +42,14 @@ pub(super) async fn emit_update(
submit_id: &str,
tx_event: &Sender<Event>,
update: McpStartupUpdateEvent,
) -> Result<(), async_channel::SendError<Event>> {
) -> Result<(), Box<async_channel::SendError<Event>>> {
tx_event
.send(Event {
id: submit_id.to_string(),
msg: EventMsg::McpStartupUpdate(update),
})
.await
.map_err(Box::new)
}
pub(super) fn mcp_startup_failure_reason(
@@ -19,6 +19,7 @@ use super::ThreadConfigSource;
use super::UserThreadConfig;
use proto::thread_config_loader_client::ThreadConfigLoaderClient;
#[allow(clippy::double_must_use)] // Emitted by async_trait in the generated tonic service.
#[path = "proto/codex.thread_config.v1.rs"]
mod proto;
+7 -4
View File
@@ -269,10 +269,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 {
+3 -3
View File
@@ -352,14 +352,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)
@@ -369,7 +369,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()?;
@@ -543,7 +543,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()
+1 -1
View File
@@ -2918,7 +2918,7 @@ 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) {
for pair in compaction_events.as_chunks::<2>().0 {
assert_eq!((pair[0].0, pair[1].0), ("started", "completed"));
assert_eq!(pair[0].1, pair[1].1);
}
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -32,7 +32,7 @@ impl Gauge {
pub fn decrement(&self) {
let _ = self
.value
.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |value| {
.try_update(Ordering::Relaxed, Ordering::Relaxed, |value| {
Some(value.saturating_sub(1))
});
}
@@ -236,7 +236,7 @@ impl EnvironmentInfo {
if let Some(path) = std::env::var_os(name)
.filter(|path| !path.is_empty())
.filter(|path| cfg!(unix) || std::path::Path::new(path).is_absolute())
.and_then(&normalize_temp_path)
.and_then(normalize_temp_path)
&& !temporary_directories.contains(&path)
{
temporary_directories.push(path);
+3 -1
View File
@@ -2318,7 +2318,9 @@ fn decode_utf16(
}
let units: Vec<u16> = input
.chunks_exact(2)
.as_chunks::<2>()
.0
.iter()
.map(|chunk| decode_unit([chunk[0], chunk[1]]))
.collect();
+2 -2
View File
@@ -328,10 +328,10 @@ async fn read_bounded_text(
let mut stream = file_system
.read_file_stream(path)
.await
.map_err(&read_error)?;
.map_err(read_error)?;
let mut contents = Vec::new();
while let Some(chunk) = stream.next().await {
let chunk = chunk.map_err(&read_error)?;
let chunk = chunk.map_err(read_error)?;
if contents.len().saturating_add(chunk.len()) > MAX_SKILL_RESOURCE_CONTENT_BYTES {
return Err(SkillProviderError::new(format!(
"executor skill resource {resource} exceeds {MAX_SKILL_RESOURCE_CONTENT_BYTES} bytes"
+2 -3
View File
@@ -222,7 +222,8 @@ fn mcp_server_toml_table(
if let Some(env) = server_config.get("env").and_then(JsonValue::as_object) {
append_env_config(&mut table, env)?;
}
} else if let Some(url) = server_config.get("url").and_then(json_string) {
} else {
let url = server_config.get("url").and_then(json_string)?;
if !matches!(
transport_type,
None | Some("http") | Some("streamable_http")
@@ -236,8 +237,6 @@ fn mcp_server_toml_table(
if let Some(headers) = server_config.get("headers").and_then(JsonValue::as_object) {
append_header_config(&mut table, headers)?;
}
} else {
return None;
}
Some(table)
+21 -21
View File
@@ -296,17 +296,17 @@ fn otlp_http_exporter_honors_cumulative_temporality_env() -> Result<()> {
assert!(
body.contains("codex.turns"),
"expected metric name not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
assert!(
body.contains("codex.active"),
"expected gauge not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
assert!(
body.contains("\"codex.api_request\""),
"expected API-request counter not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
assert!(
body.contains(EXEC_SERVER_CLIENT_REQUEST_COUNT_METRIC),
@@ -315,47 +315,47 @@ fn otlp_http_exporter_honors_cumulative_temporality_env() -> Result<()> {
assert!(
body.contains("\"codex.api_request.duration_ms\""),
"expected API-request duration not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
assert!(
body.contains("\"codex.conversation.turn.count\""),
"expected conversation turn count not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
assert!(
body.contains("\"codex.responses_api_engine_iapi_ttft.duration_ms\""),
"expected engine IAPI TTFT duration not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
assert!(
body.contains("\"codex.responses_api_engine_service_tbt.duration_ms\""),
"expected engine service TBT duration not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
assert!(
body.contains("\"codex.responses_api_engine_service_ttft.duration_ms\""),
"expected engine service TTFT duration not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
assert!(
body.contains("\"codex.tool.call\""),
"expected tool-call counter not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
assert!(
body.contains("\"codex.turn.token_usage\""),
"expected turn-token histogram not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
assert!(
body.contains("\"codex.tool.call.duration_ms\""),
"expected tool-call duration not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
assert!(
body.contains("component") && body.contains("test"),
"expected gauge tag not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
Ok(())
@@ -449,7 +449,7 @@ fn otlp_http_exporter_sends_logs_to_collector()
assert!(
body.contains("codex.test.log_exported"),
"expected exported log event not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
Ok(())
}
@@ -609,22 +609,22 @@ fn otlp_http_exporter_sends_traces_to_collector()
assert!(
body.contains("trace-loopback"),
"expected span name not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
assert!(
body.contains("codex-cli"),
"expected service name not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
assert!(
body.contains("test.configured_attribute") && body.contains("configured-value"),
"expected configured span attribute not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
assert!(
body.contains("codex.test.trace_event"),
"expected trace event not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
Ok(())
@@ -726,12 +726,12 @@ async fn otlp_http_exporter_sends_traces_to_collector_with_bounded_shutdown_in_t
assert!(
body.contains("trace-loopback-tokio"),
"expected span name not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
assert!(
body.contains("codex-cli"),
"expected service name not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
Ok(())
@@ -928,12 +928,12 @@ fn otlp_http_exporter_sends_traces_to_collector_in_current_thread_tokio_runtime(
assert!(
body.contains("trace-loopback-current-thread"),
"expected span name not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
assert!(
body.contains("codex-cli"),
"expected service name not found; body prefix: {}",
&body.chars().take(2000).collect::<String>()
body.chars().take(2000).collect::<String>()
);
Ok(())
+1 -1
View File
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.95.0"
channel = "1.99.1"
components = ["clippy", "rustfmt", "rust-src"]
+3 -3
View File
@@ -2031,7 +2031,7 @@ fn create_seatbelt_args_with_read_only_git_and_codex_subpaths() {
assert!(
!output.status.success(),
"command to write {} should fail under seatbelt",
&config_toml.display()
config_toml.display()
);
assert_seatbelt_denied(&output.stderr, &config_toml);
@@ -2069,7 +2069,7 @@ fn create_seatbelt_args_with_read_only_git_and_codex_subpaths() {
assert!(
!output.status.success(),
"command to write {} should fail under seatbelt",
&pre_commit_hook.display()
pre_commit_hook.display()
);
assert_seatbelt_denied(&output.stderr, &pre_commit_hook);
@@ -2107,7 +2107,7 @@ fn create_seatbelt_args_with_read_only_git_and_codex_subpaths() {
assert!(
output.status.success(),
"command to write {} should succeed under seatbelt",
&allowed_file.display()
allowed_file.display()
);
assert_eq!(
"this is allowed\n",
+1 -1
View File
@@ -179,7 +179,7 @@ if (-not (Ensure-Command 'cargo')) {
Write-Host "==> Configuring Rust toolchain per rust-toolchain.toml" -ForegroundColor Cyan
# Pin to the workspace toolchain and install components
$toolchain = '1.95.0'
$toolchain = '1.99.1'
& rustup toolchain install $toolchain --profile minimal | Out-Host
& rustup default $toolchain | Out-Host
& rustup component add clippy rustfmt rust-src --toolchain $toolchain | Out-Host
+2 -5
View File
@@ -88,11 +88,8 @@ pub fn try_parse_word_only_commands_sequence(tree: &Tree, src: &str) -> Option<V
let mut commands = Vec::new();
for node in command_nodes {
if let Some(words) = parse_plain_command_from_node(node, src) {
commands.push(words);
} else {
return None;
}
let words = parse_plain_command_from_node(node, src)?;
commands.push(words);
}
Some(commands)
}
+1 -1
View File
@@ -129,7 +129,7 @@ pub(super) async fn reconnect(
}
// Transport errors can contain endpoint credentials. Do not render or log them.
}
color_eyre::eyre::bail!("Server connection could not be restored")
color_eyre::eyre::bail!("Server connection could not be restored");
}
impl App {
@@ -1207,7 +1207,7 @@ async fn command_center_new_checkout_and_worktree_preserve_source_and_default_br
return Ok::<_, color_eyre::Report>(());
}
}
color_eyre::eyre::bail!("permissions menu event stream closed")
color_eyre::eyre::bail!("permissions menu event stream closed");
})
.await??;
app.chat_widget.handle_key_event(KeyCode::Up.into());
@@ -1909,7 +1909,7 @@ async fn older_external_server_starts_without_unsupported_dynamic_tools_or_histo
let starts = recorded_params(&requests, "thread/start");
assert_eq!(starts.len(), 6);
for attempts in starts.chunks_exact(3) {
for attempts in starts.as_chunks::<3>().0 {
assert_eq!(attempts[0]["dynamicTools"][0]["type"], "namespace");
assert_eq!(attempts[0]["historyMode"], "paginated");
assert_eq!(attempts[1]["dynamicTools"], serde_json::Value::Null);
@@ -194,7 +194,7 @@ async fn run_verification_rpc_scenario(scenario: RpcScenario) -> color_eyre::Res
}
}
}
color_eyre::eyre::bail!("connection closed before the elicitation response")
color_eyre::eyre::bail!("connection closed before the elicitation response");
});
let client = crate::connect_remote_app_server(endpoint).await?;
let mode = if scenario == RpcScenario::RemoteWorkspace {
+1 -1
View File
@@ -616,7 +616,7 @@ pub(crate) fn backtrack_revert_before_turn_id(
}
}
bail!("the selected prompt was not found in the persisted thread")
bail!("the selected prompt was not found in the persisted thread");
}
/// Returns whether a turn is the reconstructed inline-review child with duplicated prompt inputs.
+1 -1
View File
@@ -17,7 +17,7 @@ use codex_utils_absolute_path::AbsolutePathBuf;
pub(crate) async fn connect(target: &AppServerTarget) -> color_eyre::Result<AppServerClient> {
match target {
AppServerTarget::Embedded => {
color_eyre::eyre::bail!("embedded sessions have no remote connection")
color_eyre::eyre::bail!("embedded sessions have no remote connection");
}
#[cfg(windows)]
AppServerTarget::LocalDaemon {
@@ -48,9 +48,8 @@ impl AsyncQuestions {
let mut spacer_after_input = 0;
let progress_height;
let footer_lines;
let notes_height;
if has_options {
let notes_height = if has_options {
let full_options_height = self.options_required_height(area.width);
let min_options_height = remaining.min(1);
// Reserve hints and spacers while retaining a row for the selected option.
@@ -68,7 +67,7 @@ impl AsyncQuestions {
spacer_after_question = u16::from(remaining > 0);
remaining -= spacer_after_question;
options_height += remaining.min(full_options_height.saturating_sub(options_height));
notes_height = 0;
0
} else {
// Freeform answers take their preferred input height before hints and progress.
let preferred_notes = self
@@ -87,10 +86,8 @@ impl AsyncQuestions {
// Drop padding before input or prompt content in a constrained viewport.
spacer_before_question = u16::from(remaining >= 2 && self.unanswered_count() > 1);
spacer_after_question = u16::from(remaining >= 1);
notes_height = min_notes + preferred_notes + remaining
- spacer_before_question
- spacer_after_question;
}
min_notes + preferred_notes + remaining - spacer_before_question - spacer_after_question
};
let mut y = area.y;
let mut take_rows = |height| {
@@ -1119,7 +1119,7 @@ impl ListSelectionView {
None
}
.or_else(|| self.footer_note.clone());
let mut lines = note.map(&wrap).unwrap_or_default();
let mut lines = note.map(wrap).unwrap_or_default();
if self.reserve_result_rows && show_selected_description {
let height = self
.items
@@ -22,12 +22,12 @@ Buffer {
[
Line::from_iter([
Span::from("ab").bold(),
Span::from("カ\u{ff9e}").cyan(),
Span::from("ガ").cyan(),
Span::from("…").cyan(),
]),
Line::from_iter([
Span::from("xy").bold(),
Span::from("ハ\u{ff9f}").magenta(),
Span::from("パ").magenta(),
Span::from("…").magenta(),
]),
]
+3 -1
View File
@@ -151,7 +151,9 @@ fn render_navigation_hints(area: Rect, buf: &mut Buffer, keymap: &PagerKeymap) {
("jump_bottom", &keymap.jump_bottom),
];
let hints = actions
.chunks_exact(2)
.as_chunks::<2>()
.0
.iter()
.zip(["to scroll", "to page", "to jump"])
.map(|(actions, description)| {
(
+1 -1
View File
@@ -216,7 +216,7 @@ struct Palette {
impl Palette {
fn from_rgba(rgba: &[u8]) -> Self {
let mut used = [false; PALETTE_COLOR_COUNT];
for pixel in rgba.chunks_exact(4) {
for pixel in rgba.as_chunks::<4>().0 {
if pixel[3] < TRANSPARENT_ALPHA_THRESHOLD {
continue;
}
@@ -263,7 +263,9 @@ fn render_windows_opaque_fallback(path_bytes: &[u8]) -> Option<String> {
return None;
}
let path_wide = path_bytes
.chunks_exact(2)
.as_chunks::<2>()
.0
.iter()
.map(|bytes| u16::from_le_bytes([bytes[0], bytes[1]]))
.collect::<Vec<_>>();
+8 -3
View File
@@ -587,8 +587,11 @@ impl PathUri {
use std::os::windows::ffi::OsStringExt;
path_bytes.len().is_multiple_of(2).then(|| {
let path_wide = path_bytes
.chunks_exact(2)
.map(|bytes| u16::from_le_bytes([bytes[0], bytes[1]]))
.as_chunks::<2>()
.0
.iter()
.copied()
.map(u16::from_le_bytes)
.collect::<Vec<_>>();
std::path::PathBuf::from(std::ffi::OsString::from_wide(&path_wide))
})
@@ -819,7 +822,9 @@ fn infer_opaque_path_convention(path_bytes: &[u8]) -> Option<PathConvention> {
}
let mut path_wide = path_bytes
.chunks_exact(2)
.as_chunks::<2>()
.0
.iter()
.map(|bytes| u16::from_le_bytes([bytes[0], bytes[1]]));
let first = path_wide.next()?;
let second = path_wide.next()?;
@@ -92,7 +92,7 @@ where
.iter()
.map(|spec| longest_suffix_prefix_len(pending, spec.open))
.max()
.map_or(0, std::convert::identity)
.unwrap_or(0)
}
fn push_visible_prefix(out: &mut StreamTextChunk<ExtractedInlineTag<T>>, pending: &str) {
@@ -18,7 +18,9 @@ fn microphone_selection_excludes_playback_channels() {
unplugged[0] = 0.0;
let interleaved = [plugged_in, unplugged].concat();
let captured: Vec<_> = interleaved
.chunks_exact(/*chunk_size*/ 16)
.as_chunks::<16>()
.0
.iter()
.map(|frame| source.sample(frame))
.collect();
assert_eq!(captured, vec![0.25, 0.0]);
+2 -2
View File
@@ -67,8 +67,8 @@ impl PlaybackWriter {
at: Instant::now(),
generation: self.epoch,
};
for (sample, bytes) in frame.samples.iter_mut().zip(bytes.chunks_exact(4)) {
*sample = f32::from_le_bytes(bytes.try_into().map_err(|_| "invalid speaker buffer")?);
for (sample, bytes) in frame.samples.iter_mut().zip(bytes.as_chunks::<4>().0) {
*sample = f32::from_le_bytes(*bytes);
if !sample.is_finite() {
return Err("invalid speaker sample");
}
+1 -1
View File
@@ -444,7 +444,7 @@ fn sha256_digest_arg(flag_name: &str, value: &str) -> anyhow::Result<[u8; 32]> {
}
let mut digest = [0u8; 32];
for (index, pair) in trimmed.as_bytes().chunks_exact(2).enumerate() {
for (index, pair) in trimmed.as_bytes().as_chunks::<2>().0.iter().enumerate() {
let high = hex_nibble(flag_name, pair[0])?;
let low = hex_nibble(flag_name, pair[1])?;
digest[index] = (high << 4) | low;