fix(rust): remove unused imports, variables, and dead code causing CI build failures

- Remove unused imports: AtomicBool, Future (provider.rs), debug (executor.rs)
- Remove unused import WorkflowScript (workflow.rs)
- Remove unused variables: tool_name, t_ctx, t_args (executor.rs)
- Remove dead variable class_indent (semantic_search.rs)

CI was failing with 'error: could not compile zesdex-infrastructure
due to 10 previous errors' caused by -D warnings treating unused
code as compilation errors.
This commit is contained in:
Cyrene (Mem)
2026-07-22 13:57:50 +07:00
parent b3a4d131d1
commit eb8cc17993
4 changed files with 1 additions and 18 deletions
-2
View File
@@ -2,9 +2,7 @@
//! supporting both non-streaming and SSE-streaming requests with automatic retry. //! supporting both non-streaming and SSE-streaming requests with automatic retry.
use rand_core::RngCore; use rand_core::RngCore;
use std::sync::atomic::AtomicBool;
use std::time::Duration; use std::time::Duration;
use std::future::Future;
use zesdex_domain::core::{ use zesdex_domain::core::{
ChatMessage, ChatRequest, ChatResponse, SseParser, StreamEvent, StreamOptions, ToolDef, ChatMessage, ChatRequest, ChatResponse, SseParser, StreamEvent, StreamOptions, ToolDef,
-12
View File
@@ -2,7 +2,6 @@ use std::future::Future;
use anyhow::Result; use anyhow::Result;
use zesdex_application::agent::ToolExecutor; use zesdex_application::agent::ToolExecutor;
use crate::tools::{all_tools, Tool, ToolCtx}; use crate::tools::{all_tools, Tool, ToolCtx};
use tracing::debug;
pub struct InfrastructureToolExecutor { pub struct InfrastructureToolExecutor {
ctx: ToolCtx, ctx: ToolCtx,
@@ -32,17 +31,6 @@ impl ToolExecutor for InfrastructureToolExecutor {
async move { async move {
match tool_opt { match tool_opt {
Some(tool) => { Some(tool) => {
// Tool::run is synchronous, so we run it in a blocking task if needed
// For now, since they run fast and we are transitioning, we can just block in place.
// Or tokio::task::spawn_blocking:
let tool_name = tool.name().to_string();
let t_ctx = ctx.clone();
let t_args = args.clone();
// Because Tool isn't easily cloned, we might just block on the current thread,
// or use tokio::task::block_in_place if we're in a tokio runtime.
// But `tool.run` takes `&self`, and we have `&self` borrowed.
// For now we just call it directly.
tokio::task::block_in_place(move || { tokio::task::block_in_place(move || {
tool.run(&ctx, &args) tool.run(&ctx, &args)
}) })
@@ -872,7 +872,6 @@ fn extract_python(content: &str, rel_path: &str) -> Vec<CodeSymbol> {
// Track current class for method nesting // Track current class for method nesting
// Reset when we see a non-indented line outside a class. // Reset when we see a non-indented line outside a class.
let mut current_class: Option<String> = None; let mut current_class: Option<String> = None;
let mut class_indent: Option<usize> = None;
for (i, line) in lines.iter().enumerate() { for (i, line) in lines.iter().enumerate() {
let line_num = i + 1; let line_num = i + 1;
@@ -882,14 +881,12 @@ fn extract_python(content: &str, rel_path: &str) -> Vec<CodeSymbol> {
// Reset class tracking when we leave its indentation level. // Reset class tracking when we leave its indentation level.
if current_class.is_some() && indent == 0 && !trimmed.is_empty() { if current_class.is_some() && indent == 0 && !trimmed.is_empty() {
current_class = None; current_class = None;
class_indent = None;
} }
// Class // Class
if let Some(caps) = r.py_class.captures(trimmed) { if let Some(caps) = r.py_class.captures(trimmed) {
let name = caps.get(1).unwrap().as_str().to_string(); let name = caps.get(1).unwrap().as_str().to_string();
current_class = Some(name.clone()); current_class = Some(name.clone());
class_indent = Some(indent);
symbols.push(CodeSymbol { symbols.push(CodeSymbol {
name, name,
kind: SymbolKind::Class, kind: SymbolKind::Class,
+1 -1
View File
@@ -14,7 +14,7 @@ use crate::tools::{arg_str, Tool, ToolCtx};
use crate::workflow::engine::execution::execute_workflow; use crate::workflow::engine::execution::execute_workflow;
use crate::workflow::hive_mind::cycle::execute_cycle; use crate::workflow::hive_mind::cycle::execute_cycle;
use crate::workflow::hive_mind::synthesis::synthesize_consensus; use crate::workflow::hive_mind::synthesis::synthesize_consensus;
use zesdex_domain::workflow::{CognitiveCycle, NodeDirective, NodeOutput, WorkflowScript}; use zesdex_domain::workflow::{CognitiveCycle, NodeDirective, NodeOutput};
/// Execute a multi-step workflow defined in YAML. /// Execute a multi-step workflow defined in YAML.
/// ///