mirror of
https://github.com/openai/codex.git
synced 2026-09-06 15:29:32 +00:00
guardian: remove the codex-core dependency
This commit is contained in:
1
codex-rs/Cargo.lock
generated
1
codex-rs/Cargo.lock
generated
@@ -3069,7 +3069,6 @@ dependencies = [
|
||||
name = "codex-guardian"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"codex-core",
|
||||
"codex-extension-api",
|
||||
"codex-protocol",
|
||||
]
|
||||
|
||||
@@ -14,6 +14,5 @@ doctest = false
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
codex-core = { workspace = true }
|
||||
codex-extension-api = { workspace = true }
|
||||
codex-protocol = { workspace = true }
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user