Skip to content

Commit

Permalink
- fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
agallardol committed Nov 28, 2024
1 parent 3dda35e commit 809443d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
9 changes: 1 addition & 8 deletions libs/shinkai-tools-runner/src/built_in_tools.test.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
use std::collections::HashMap;

use serde_json::Value;

use crate::{
built_in_tools::{get_tool, get_tools},
tools::code_files::CodeFiles,
};
use crate::built_in_tools::{get_tool, get_tools};

#[tokio::test]
async fn list_tools_count() {
Expand Down
2 changes: 1 addition & 1 deletion libs/shinkai-tools-runner/src/copy_assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::io::Write;
use std::path::Path;
use std::path::PathBuf;

pub static DENO_VERSION: &str = "v2.0.4";
pub static DENO_VERSION: &str = "v2.1.1";
static PROFILE: Lazy<String> =
Lazy::new(|| std::env::var("PROFILE").unwrap_or_else(|_| "debug".to_string()));

Expand Down
6 changes: 4 additions & 2 deletions libs/shinkai-tools-runner/src/tools/deno_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ impl DenoRunner {
});

#[allow(clippy::let_underscore_future)]
let _ = tokio::spawn(async move {
let std_tasks = tokio::spawn(async move {
let _ = futures::future::join_all(vec![stdout_task, stderr_task]).await;
});

Expand All @@ -350,6 +350,7 @@ impl DenoRunner {
log::info!("executing command without timeout");
child.wait_with_output().await?
};
let _ = std_tasks.await;
if !output.status.success() {
let stderr = stderr_lines.lock().await.to_vec().join("\n");
log::error!("command execution failed: {}", stderr);
Expand Down Expand Up @@ -489,7 +490,7 @@ impl DenoRunner {
});

#[allow(clippy::let_underscore_future)]
let _ = tokio::spawn(async move {
let std_tasks = tokio::spawn(async move {
let _ = futures::future::join_all(vec![stdout_task, stderr_task]).await;
});

Expand All @@ -509,6 +510,7 @@ impl DenoRunner {
log::info!("executing command without timeout");
child.wait_with_output().await?
};
let _ = std_tasks.await;
if !output.status.success() {
let stderr = stderr_lines.lock().await.to_vec().join("\n");
log::error!("command execution failed: {}", stderr);
Expand Down
2 changes: 1 addition & 1 deletion libs/shinkai-tools-runner/src/tools/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use serde_json::Value;

use super::{
code_files::CodeFiles, deno_runner::DenoRunner, deno_runner_options::DenoRunnerOptions,
execution_error::ExecutionError, run_result::RunResult, tool_definition::ToolDefinition,
execution_error::ExecutionError, run_result::RunResult,
};

pub struct Tool {
Expand Down

0 comments on commit 809443d

Please sign in to comment.