From 16bfbd3b71caa8af97ef0a1760f15dfa667373cd Mon Sep 17 00:00:00 2001 From: Jack Amadeo Date: Tue, 2 Jun 2026 23:49:26 -0400 Subject: [PATCH] refactor: move generic tool call result to goose-types Signed-off-by: Jack Amadeo --- crates/goose-types/src/lib.rs | 6 ++++++ crates/goose/src/conversation/message.rs | 8 +------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/goose-types/src/lib.rs b/crates/goose-types/src/lib.rs index 96d43aaf8ca6..c130ef203b6f 100644 --- a/crates/goose-types/src/lib.rs +++ b/crates/goose-types/src/lib.rs @@ -118,6 +118,12 @@ pub struct TokenState { pub accumulated_cost: Option, } +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, ToSchema)] +pub enum ToolCallResult { + Success { value: T }, + Error { error: String }, +} + impl MessageMetadata { pub fn agent_only() -> Self { Self { diff --git a/crates/goose/src/conversation/message.rs b/crates/goose/src/conversation/message.rs index a04f06be364c..30a388dd0293 100644 --- a/crates/goose/src/conversation/message.rs +++ b/crates/goose/src/conversation/message.rs @@ -5,7 +5,7 @@ use chrono::Utc; pub use goose_types::{ InferenceMetadata, MessageMetadata, MessageProviderMetadata as ProviderMetadata, RedactedThinkingContent, SystemNotificationContent, SystemNotificationType, ThinkingContent, - TokenState, + TokenState, ToolCallResult, }; use rmcp::model::{ AnnotateAble, CallToolRequestParams, CallToolResult, Content, ImageContent, JsonObject, @@ -18,12 +18,6 @@ use std::fmt; use utoipa::ToSchema; use uuid::Uuid; -#[derive(ToSchema)] -pub enum ToolCallResult { - Success { value: T }, - Error { error: String }, -} - /// Custom deserializer for MessageContent that sanitizes Unicode Tags in text content fn deserialize_sanitized_content<'de, D>(deserializer: D) -> Result, D::Error> where