From 4d6f0330dd4648b2ae4385d08a58a8a78fb50b29 Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Mon, 12 Oct 2026 19:54:29 +0300 Subject: fix: more robust action matching --- llm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llm.py') diff --git a/llm.py b/llm.py index db72ba3..7577f9f 100755 --- a/llm.py +++ b/llm.py @@ -87,10 +87,10 @@ def query_agent(query: str, config: AgentConfig, state=()): try: action = json.loads(json_str) action_name = action["action"] - except (json.JSONDecodeError, KeyError): + except (json.JSONDecodeError, KeyError, TypeError): continue - f = first(config.actions, lambda f: f.name == action_name) + f = first(config.actions, lambda f: f.name == action_name and all(k in action for k in f.required_keys)) if f is not None: desc = f.formatter(action) if ( -- cgit v1.3.1