Unverified Commit 4e51fa8c authored by Russell Bryant's avatar Russell Bryant Committed by GitHub
Browse files

Do not use eval() to convert unknown types (#23266)


Signed-off-by: default avatarRussell Bryant <rbryant@redhat.com>
parent bf7c99df
...@@ -208,15 +208,10 @@ class Qwen3CoderToolParser(ToolParser): ...@@ -208,15 +208,10 @@ class Qwen3CoderToolParser(ToolParser):
"valid JSON object in tool '%s', will try other " "valid JSON object in tool '%s', will try other "
"methods to parse it.", param_value, param_name, "methods to parse it.", param_value, param_name,
func_name) func_name)
try:
converted_value = eval(param_value)
return converted_value
except Exception:
logger.warning( logger.warning(
"Parsed value '%s' of parameter '%s' cannot be " "Parameter '%s' has unknown type '%s'. "
"converted via Python `eval()` in tool '%s', " "The value will be treated as a string.", param_name,
"degenerating to string.", param_value, param_name, param_type)
func_name)
return param_value return param_value
# Extract function name # Extract function name
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment