mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-08-27 08:00:17 +00:00
Fix schema-guided tool parameter coercion (#1143)
* Fix schema-guided tool parameter coercion * Fix CI checks for coercion regression tests * Finish panic-scan annotations * Avoid redundant worker param preparation * Keep panic-scan annotations rustfmt-stable * Handle nullable WASM schema review feedback * Address param coercion review notes
This commit is contained in:
@@ -43,8 +43,8 @@ use crate::error::ToolError as AgentToolError;
|
||||
use crate::llm::{
|
||||
ChatMessage, LlmProvider, Reasoning, ReasoningContext, RespondResult, ToolDefinition,
|
||||
};
|
||||
use crate::tools::ToolRegistry;
|
||||
use crate::tools::tool::{ApprovalRequirement, Tool, ToolError, ToolOutput};
|
||||
use crate::tools::{ToolRegistry, prepare_tool_params};
|
||||
|
||||
/// Requirement specification for building software.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
@@ -776,10 +776,11 @@ Create alongside the .wasm file to grant capabilities:
|
||||
self.tools.get(tool_name).await.ok_or_else(|| {
|
||||
ToolError::ExecutionFailed(format!("Tool not found: {}", tool_name))
|
||||
})?;
|
||||
let normalized_params = prepare_tool_params(tool.as_ref(), params);
|
||||
|
||||
// Execute with a dummy context (build tools don't need job context)
|
||||
let ctx = JobContext::default();
|
||||
tool.execute(params.clone(), &ctx).await
|
||||
tool.execute(normalized_params, &ctx).await
|
||||
}
|
||||
|
||||
/// Find the build artifact based on project type.
|
||||
|
||||
Reference in New Issue
Block a user