Skip to content

An agent-managed museum exhibit, built in Rust with Gajae-Code / LazyCodex — developed and maintained with no human intervention.

Rust

fix: add env_lock guard to git discovery tests

YeonGyu-Kim543b7725ee47
diff --git a/rust/crates/runtime/src/conversation.rs b/rust/crates/runtime/src/conversation.rs
index 1abdce41..8411b8d1 100644
--- a/rust/crates/runtime/src/conversation.rs
+++ b/rust/crates/runtime/src/conversation.rs
@@ -118,7 +118,7 @@ where
tool_executor,
permission_policy,
system_prompt,
- &RuntimeFeatureConfig::default(),
+ RuntimeFeatureConfig::default(),
)
}
@@ -129,7 +129,7 @@ where
tool_executor: T,
permission_policy: PermissionPolicy,
system_prompt: Vec<String>,
- feature_config: &RuntimeFeatureConfig,
+ feature_config: RuntimeFeatureConfig,
) -> Self {
let usage_tracker = UsageTracker::from_session(&session);
Self {
@@ -140,7 +140,7 @@ where
system_prompt,
max_iterations: usize::MAX,
usage_tracker,
- hook_runner: HookRunner::from_feature_config(feature_config),
+ hook_runner: HookRunner::from_feature_config(&feature_config),
}
}
@@ -609,7 +609,7 @@ mod tests {
}),
PermissionPolicy::new(PermissionMode::DangerFullAccess),
vec!["system".to_string()],
- &RuntimeFeatureConfig::default().with_hooks(RuntimeHookConfig::new(
+ RuntimeFeatureConfig::default().with_hooks(RuntimeHookConfig::new(
vec![shell_snippet("printf 'blocked by hook'; exit 2")],
Vec::new(),
)),
@@ -675,7 +675,7 @@ mod tests {
StaticToolExecutor::new().register("add", |_input| Ok("4".to_string())),
PermissionPolicy::new(PermissionMode::DangerFullAccess),
vec!["system".to_string()],
- &RuntimeFeatureConfig::default().with_hooks(RuntimeHookConfig::new(
+ RuntimeFeatureConfig::default().with_hooks(RuntimeHookConfig::new(
vec![shell_snippet("printf 'pre hook ran'")],
vec![shell_snippet("printf 'post hook ran'")],
)),
diff --git a/rust/crates/runtime/src/prompt.rs b/rust/crates/runtime/src/prompt.rs
index 8952682d..3ba08e17 100644
--- a/rust/crates/runtime/src/prompt.rs
+++ b/rust/crates/runtime/src/prompt.rs
@@ -600,6 +600,7 @@ mod tests {
#[test]
fn discover_with_git_includes_status_snapshot() {
+ let _guard = env_lock();
let root = temp_dir();
fs::create_dir_all(&root).expect("root dir");
std::process::Command::new("git")
@@ -624,6 +625,7 @@ mod tests {
#[test]
fn discover_with_git_includes_diff_snapshot_for_tracked_changes() {
+ let _guard = env_lock();
let root = temp_dir();
fs::create_dir_all(&root).expect("root dir");
std::process::Command::new("git")
diff --git a/rust/crates/rusty-claude-cli/src/main.rs b/rust/crates/rusty-claude-cli/src/main.rs
index 83f0993e..9452cba9 100644
--- a/rust/crates/rusty-claude-cli/src/main.rs
+++ b/rust/crates/rusty-claude-cli/src/main.rs
@@ -1933,7 +1933,7 @@ fn build_runtime(
CliToolExecutor::new(allowed_tools, emit_output),
permission_policy(permission_mode),
system_prompt,
- &feature_config,
+ feature_config,
))
}