From 102ff05bd2fefe2106122eba033a348a3ca7c3af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 17:14:08 +0000 Subject: [PATCH] chore(deps): bump rand from 0.8.6 to 0.10.1 (#9504) Signed-off-by: dependabot[bot] Signed-off-by: Douwe M Osinga Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Douwe M Osinga --- Cargo.lock | 6 +++--- Cargo.toml | 2 +- crates/goose-cli/src/cli.rs | 4 ++-- crates/goose-cli/src/session/thinking.rs | 4 ++-- crates/goose/src/config/signup_openrouter/mod.rs | 4 ++-- crates/goose/src/config/signup_tetrate/mod.rs | 4 ++-- crates/goose/src/gateway/pairing.rs | 6 +++--- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f8dfc0c39..22aafecf2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4827,7 +4827,7 @@ dependencies = [ "pctx_code_mode", "process-wrap", "pulldown-cmark", - "rand 0.8.6", + "rand 0.10.1", "rayon", "regex", "reqwest 0.13.4", @@ -4924,7 +4924,7 @@ dependencies = [ "goose-providers", "indicatif 0.18.4", "open", - "rand 0.8.6", + "rand 0.10.1", "regex", "reqwest 0.13.4", "rmcp", @@ -5061,7 +5061,7 @@ dependencies = [ "http 1.4.2", "openssl", "pem", - "rand 0.8.6", + "rand 0.10.1", "rcgen", "reqwest 0.13.4", "rmcp", diff --git a/Cargo.toml b/Cargo.toml index 8798bda6b..be0b75e1e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ indoc = { version = "2", default-features = false } keyring = { version = "3.6.3", default-features = false, features = ["vendored"] } lru = { version = "0.18", default-features = false } once_cell = { version = "1.21.3", default-features = false, features = ["std"] } -rand = { version = "0.8.5", default-features = false, features = ["std"] } +rand = "0.10.1" regex = { version = "1.12.3", default-features = false, features = ["std"] } reqwest = { version = "0.13.2", default-features = false, features = ["multipart", "form"] } rustls = { version = "0.23.31", default-features = false, features = ["aws_lc_rs", "std"] } diff --git a/crates/goose-cli/src/cli.rs b/crates/goose-cli/src/cli.rs index 1e19c5fa3..38a0ec262 100644 --- a/crates/goose-cli/src/cli.rs +++ b/crates/goose-cli/src/cli.rs @@ -43,11 +43,11 @@ use tracing::warn; const GOOSE_SERVER_SECRET_KEY_ENV: &str = "GOOSE_SERVER__SECRET_KEY"; fn generate_serve_secret_key() -> String { - use rand::distributions::{Alphanumeric, DistString}; + use rand::distr::{Alphanumeric, SampleString}; format!( "goose-acp-{}", - Alphanumeric.sample_string(&mut rand::thread_rng(), 32) + Alphanumeric.sample_string(&mut rand::rng(), 32) ) } diff --git a/crates/goose-cli/src/session/thinking.rs b/crates/goose-cli/src/session/thinking.rs index 6b36c756b..d4948b55c 100644 --- a/crates/goose-cli/src/session/thinking.rs +++ b/crates/goose-cli/src/session/thinking.rs @@ -1,4 +1,4 @@ -use rand::seq::SliceRandom; +use rand::seq::IndexedRandom; /// Extended list of playful thinking messages including both goose and general AI actions const THINKING_MESSAGES: &[&str] = &[ @@ -215,6 +215,6 @@ const THINKING_MESSAGES: &[&str] = &[ /// Returns a random thinking message from the extended list pub fn get_random_thinking_message() -> &'static str { THINKING_MESSAGES - .choose(&mut rand::thread_rng()) + .choose(&mut rand::rng()) .unwrap_or(&THINKING_MESSAGES[0]) } diff --git a/crates/goose/src/config/signup_openrouter/mod.rs b/crates/goose/src/config/signup_openrouter/mod.rs index 26b2655a0..3717cf67c 100644 --- a/crates/goose/src/config/signup_openrouter/mod.rs +++ b/crates/goose/src/config/signup_openrouter/mod.rs @@ -5,7 +5,7 @@ mod tests; use anyhow::{anyhow, Result}; use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine}; -use rand::{distributions::Alphanumeric, Rng}; +use rand::{distr::Alphanumeric, RngExt}; use reqwest::Client; use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; @@ -42,7 +42,7 @@ struct TokenRequest { impl PkceAuthFlow { pub fn new() -> Result { - let code_verifier: String = rand::thread_rng() + let code_verifier: String = rand::rng() .sample_iter(&Alphanumeric) .take(128) .map(char::from) diff --git a/crates/goose/src/config/signup_tetrate/mod.rs b/crates/goose/src/config/signup_tetrate/mod.rs index c8adc9e91..fc13f8cd7 100644 --- a/crates/goose/src/config/signup_tetrate/mod.rs +++ b/crates/goose/src/config/signup_tetrate/mod.rs @@ -5,7 +5,7 @@ mod tests; use anyhow::{anyhow, Result}; use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine}; -use rand::{distributions::Alphanumeric, Rng}; +use rand::{distr::Alphanumeric, RngExt}; use reqwest::Client; use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; @@ -42,7 +42,7 @@ struct TokenRequest { impl PkceAuthFlow { pub fn new() -> Result { - let code_verifier: String = rand::thread_rng() + let code_verifier: String = rand::rng() .sample_iter(&Alphanumeric) .take(128) .map(char::from) diff --git a/crates/goose/src/gateway/pairing.rs b/crates/goose/src/gateway/pairing.rs index 6ae272436..70c8eac0c 100644 --- a/crates/goose/src/gateway/pairing.rs +++ b/crates/goose/src/gateway/pairing.rs @@ -136,11 +136,11 @@ impl PairingStore { } pub fn generate_code() -> String { - use rand::Rng; + use rand::RngExt; let chars: &[u8] = b"ABCDEFGHJKLMNPQRSTUVWXYZ23456789"; - let mut rng = rand::thread_rng(); + let mut rng = rand::rng(); (0..6) - .map(|_| chars[rng.gen_range(0..chars.len())] as char) + .map(|_| chars[rng.random_range(0..chars.len())] as char) .collect() }