guardian: remove the codex-core dependency

This commit is contained in:
Dylan Hurd
2026-06-11 23:12:39 -07:00
parent ac735a879a
commit 7112558bfd
3 changed files with 5 additions and 9 deletions

1
codex-rs/Cargo.lock generated
View File

@@ -3069,7 +3069,6 @@ dependencies = [
name = "codex-guardian"
version = "0.0.0"
dependencies = [
"codex-core",
"codex-extension-api",
"codex-protocol",
]

View File

@@ -14,6 +14,5 @@ doctest = false
workspace = true
[dependencies]
codex-core = { workspace = true }
codex-extension-api = { workspace = true }
codex-protocol = { workspace = true }

View File

@@ -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<S> ThreadLifecycleContributor<Config> for GuardianExtension<S>
impl<C, S> ThreadLifecycleContributor<C> for GuardianExtension<S>
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<S>(registry: &mut ExtensionRegistryBuilder<Config>, agent_spawner: S)
pub fn install<C, S>(registry: &mut ExtensionRegistryBuilder<C>, agent_spawner: S)
where
C: Sync,
S: Send + Sync + 'static,
{
let extension = Arc::new(GuardianExtension::new(agent_spawner));