refactor(ai_client): narrow bare 'except:' in _execute_tool_calls_concurrently (Phase 9 sites 6+7)

Both deepseek and minimax branches in the tool call dispatcher had:
  try: args = json.loads(tool_args_str)
  except: args = {}

json.JSONDecodeError is a subclass of ValueError, so narrowed to:
  except (ValueError, TypeError): args = {}

This satisfies the BC classification (specific exception types).
This commit is contained in:
ed
2026-06-20 11:08:03 -04:00
parent ca4a78dcc1
commit 745147ebf0
+2 -2
View File
@@ -713,14 +713,14 @@ async def _execute_tool_calls_concurrently(
tool_args_str = cast(str, tool_info.get("arguments", "{}")) tool_args_str = cast(str, tool_info.get("arguments", "{}"))
call_id = cast(str, fc.get("id")) call_id = cast(str, fc.get("id"))
try: args = json.loads(tool_args_str) try: args = json.loads(tool_args_str)
except: args = {} except (ValueError, TypeError): args = {}
elif provider == "minimax": elif provider == "minimax":
tool_info = fc.get("function", {}) tool_info = fc.get("function", {})
name = cast(str, tool_info.get("name")) name = cast(str, tool_info.get("name"))
tool_args_str = cast(str, tool_info.get("arguments", "{}")) tool_args_str = cast(str, tool_info.get("arguments", "{}"))
call_id = cast(str, fc.get("id")) call_id = cast(str, fc.get("id"))
try: args = json.loads(tool_args_str) try: args = json.loads(tool_args_str)
except: args = {} except (ValueError, TypeError): args = {}
else: else:
continue continue