From 7112558bfde4ffc258b61da91571429e9501fdaf Mon Sep 17 00:00:00 2001 From: Dylan Hurd Date: Thu, 11 Jun 2026 23:12:39 -0700 Subject: [PATCH] guardian: remove the codex-core dependency --- codex-rs/Cargo.lock | 1 - codex-rs/ext/guardian/Cargo.toml | 1 - codex-rs/ext/guardian/src/lib.rs | 12 +++++------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/codex-rs/Cargo.lock b/codex-rs/Cargo.lock index dfd339083f..613a45872d 100644 --- a/codex-rs/Cargo.lock +++ b/codex-rs/Cargo.lock @@ -3069,7 +3069,6 @@ dependencies = [ name = "codex-guardian" version = "0.0.0" dependencies = [ - "codex-core", "codex-extension-api", "codex-protocol", ] diff --git a/codex-rs/ext/guardian/Cargo.toml b/codex-rs/ext/guardian/Cargo.toml index 513254b7cf..2020ec7551 100644 --- a/codex-rs/ext/guardian/Cargo.toml +++ b/codex-rs/ext/guardian/Cargo.toml @@ -14,6 +14,5 @@ doctest = false workspace = true [dependencies] -codex-core = { workspace = true } codex-extension-api = { workspace = true } codex-protocol = { workspace = true } diff --git a/codex-rs/ext/guardian/src/lib.rs b/codex-rs/ext/guardian/src/lib.rs index 240a84768b..9866888edb 100644 --- a/codex-rs/ext/guardian/src/lib.rs +++ b/codex-rs/ext/guardian/src/lib.rs @@ -1,6 +1,5 @@ use std::sync::Arc; -use codex_core::config::Config; use codex_extension_api::AgentSpawnFuture; use codex_extension_api::AgentSpawner; use codex_extension_api::ApprovalReviewContributor; @@ -53,14 +52,12 @@ impl GuardianThreadContext { } } -impl ThreadLifecycleContributor for GuardianExtension +impl ThreadLifecycleContributor for GuardianExtension where + C: Sync, S: Send + Sync, { - fn on_thread_start<'a>( - &'a self, - input: ThreadStartInput<'a, Config>, - ) -> ExtensionFuture<'a, ()> { + fn on_thread_start<'a>(&'a self, input: ThreadStartInput<'a, C>) -> ExtensionFuture<'a, ()> { Box::pin(async move { let Ok(forked_from_thread_id) = ThreadId::from_string(input.thread_store.level_id()) else { @@ -97,8 +94,9 @@ where } /// Installs the guardian contributors into the extension registry. -pub fn install(registry: &mut ExtensionRegistryBuilder, agent_spawner: S) +pub fn install(registry: &mut ExtensionRegistryBuilder, agent_spawner: S) where + C: Sync, S: Send + Sync + 'static, { let extension = Arc::new(GuardianExtension::new(agent_spawner));