remove unsafe

This commit is contained in:
Ahmed Ibrahim
2025-07-17 10:51:19 -07:00
parent 47725f9fa8
commit df04fddbc4
2 changed files with 1 additions and 14 deletions

View File

@@ -261,8 +261,7 @@ async fn process_sse<S>(
stream: S,
tx_event: mpsc::Sender<Result<ResponseEvent>>,
idle_timeout: Duration,
)
where
) where
S: Stream<Item = Result<Bytes>> + Unpin,
{
let mut stream = stream.eventsource();

View File

@@ -45,18 +45,6 @@ async fn spawn_codex() -> Result<Codex, CodexErr> {
"OPENAI_API_KEY must be set for live tests"
);
// Environment tweaks to keep the tests snappy and inexpensive while still
// exercising retry/robustness logic.
//
// NOTE: Starting with the 2024 edition `std::env::set_var` is `unsafe`
// because changing the process environment races with any other threads
// that might be performing environment look-ups at the same time.
// Restrict the unsafety to this tiny block that happens at the very
// beginning of the test, before we spawn any background tasks that could
// observe the environment.
// Configure retry behaviour explicitly to avoid mutating process-wide
// environment variables.
let codex_home = TempDir::new().unwrap();
let mut config = load_default_config_for_test(&codex_home);
config.openai_request_max_retries = 2;