Skip to content

Commit 6e0ac28

Browse files
committed
chore: cargo fmt
Signed-off-by: Harrison <hcstebbins@gmail.com>
1 parent f67dabb commit 6e0ac28

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

crates/goose-cli/src/session/export.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,8 +654,10 @@ mod tests {
654654

655655
#[test]
656656
fn test_message_to_markdown_thinking() {
657-
let message = Message::assistant()
658-
.with_thinking("I need to analyze this problem...", Some("test-signature".to_string()));
657+
let message = Message::assistant().with_thinking(
658+
"I need to analyze this problem...",
659+
Some("test-signature".to_string()),
660+
);
659661

660662
let result = message_to_markdown(&message, true);
661663
assert!(result.contains("**Thinking:**"));

crates/goose/src/providers/formats/google.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,9 @@ fn process_response_part_impl(
284284
return None;
285285
}
286286
match (signature, signed_text_handling) {
287-
(Some(sig), SignedTextHandling::SignedTextAsThinking) => {
288-
Some(MessageContent::thinking(text.to_string(), Some(sig.to_string())))
289-
}
287+
(Some(sig), SignedTextHandling::SignedTextAsThinking) => Some(
288+
MessageContent::thinking(text.to_string(), Some(sig.to_string())),
289+
),
290290
_ => Some(MessageContent::text(text.to_string())),
291291
}
292292
} else if text_value.is_some() {
@@ -969,8 +969,8 @@ mod tests {
969969
assert_eq!(google_out[0]["parts"][0]["thoughtSignature"], SIG);
970970
assert_eq!(google_out[1]["parts"][0]["thoughtSignature"], SIG);
971971

972-
let second_assistant =
973-
Message::assistant().with_thinking("More thinking".to_string(), Some("sig_456".to_string()));
972+
let second_assistant = Message::assistant()
973+
.with_thinking("More thinking".to_string(), Some("sig_456".to_string()));
974974
let google_multi = format_messages(&[native, tool_response, second_assistant]);
975975
assert!(google_multi[0]["parts"][0]
976976
.get("thoughtSignature")

crates/goose/src/providers/formats/openai.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,12 +1740,21 @@ data: [DONE]
17401740
let message = response_to_message(&response)?;
17411741

17421742
// First content should be ThinkingContent (reasoning)
1743-
assert!(message.content.len() >= 2, "Expected at least 2 content items");
1743+
assert!(
1744+
message.content.len() >= 2,
1745+
"Expected at least 2 content items"
1746+
);
17441747
if let MessageContent::Thinking(thinking) = &message.content[0] {
17451748
assert_eq!(thinking.thinking, "Let me think about this step by step...");
1746-
assert!(thinking.signature.is_none(), "OpenAI-compatible signature should be None");
1749+
assert!(
1750+
thinking.signature.is_none(),
1751+
"OpenAI-compatible signature should be None"
1752+
);
17471753
} else {
1748-
panic!("Expected Thinking content as first item, got {:?}", message.content[0]);
1754+
panic!(
1755+
"Expected Thinking content as first item, got {:?}",
1756+
message.content[0]
1757+
);
17491758
}
17501759

17511760
// Second content should be text
@@ -1800,7 +1809,8 @@ data: [DONE]
18001809
}
18011810

18021811
#[test]
1803-
fn test_format_messages_tool_calls_without_thinking_includes_empty_reasoning() -> anyhow::Result<()> {
1812+
fn test_format_messages_tool_calls_without_thinking_includes_empty_reasoning(
1813+
) -> anyhow::Result<()> {
18041814
// Test that reasoning_content is included (empty) when tool_calls present but no thinking
18051815
let message = Message::assistant().with_tool_request(
18061816
"call_1",

0 commit comments

Comments
 (0)