Skip to content

Commit 8ec6b2b

Browse files
committed
Fix: Screen capture w.title() handling
Resolves compilation errors where `w.title()`'s `Result` type was not properly handled for string conversions and comparisons.
1 parent d510fee commit 8ec6b2b

File tree

1 file changed

+2
-2
lines changed
  • crates/goose-mcp/src/developer

1 file changed

+2
-2
lines changed

crates/goose-mcp/src/developer/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,7 @@ impl DeveloperRouter {
12621262
.map_err(|_| ToolError::ExecutionError("Failed to list windows".into()))?;
12631263

12641264
let window_titles: Vec<String> =
1265-
windows.into_iter().map(|w| w.title().to_string()).collect();
1265+
windows.into_iter().map(|w| w.title().unwrap_or_default()).collect();
12661266

12671267
Ok(vec![
12681268
Content::text(format!("Available windows:\n{}", window_titles.join("\n")))
@@ -1402,7 +1402,7 @@ impl DeveloperRouter {
14021402

14031403
let window = windows
14041404
.into_iter()
1405-
.find(|w| w.title() == window_title)
1405+
.find(|w| w.title().ok().as_deref() == Some(window_title))
14061406
.ok_or_else(|| {
14071407
ToolError::ExecutionError(format!(
14081408
"No window found with title '{}'",

0 commit comments

Comments
 (0)