From 509fcac69d5faf2d7623d6051c9df46b76751d7c Mon Sep 17 00:00:00 2001 From: sings-to-bees-on-wednesdays <222684290+sings-to-bees-on-wednesdays@users.noreply.github.com> Date: Mon, 29 Sep 2025 19:26:56 +0000 Subject: [PATCH] fix(token_counter): fix panic with GitHub Copilot (#4632) Signed-off-by: sings-to-bees-on-wednesdays <222684290+sings-to-bees-on-wednesdays@users.noreply.github.com> main was broken. this seems important --- crates/goose/src/token_counter.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/goose/src/token_counter.rs b/crates/goose/src/token_counter.rs index c95493df..31f16a79 100644 --- a/crates/goose/src/token_counter.rs +++ b/crates/goose/src/token_counter.rs @@ -90,7 +90,9 @@ impl AsyncTokenCounter { let line = format!("{}:{}", name, description); func_token_count += self.count_tokens(&line); - if let serde_json::Value::Object(properties) = &tool.input_schema["properties"] { + if let Some(serde_json::Value::Object(properties)) = + tool.input_schema.get("properties") + { if !properties.is_empty() { func_token_count += prop_init; for (key, value) in properties {