Skip to content

Commit f409933

Browse files
fix(eval): decode JSON-encoded external_recipients in alert_skill check
The create_metric_alert tool returns external_recipients as a JSON-encoded string (e.g. '["email@example.com"]') rather than a list. Use json.loads before falling back to CSV splitting so recipients comparison works correctly. JIRA: GDAI-1830 risk: nonprod
1 parent ccbb77d commit f409933

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

packages/gooddata-eval/src/gooddata_eval/core/agentic/alert_skill.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@ def _check_recipients(expected: CatalogMetricAlert, actual_args: dict) -> bool:
9999
return True
100100
act_recip_raw = actual_args.get("recipients", actual_args.get("external_recipients"))
101101
if isinstance(act_recip_raw, str):
102-
act_recip = _parse_recipients(act_recip_raw)
102+
# external_recipients is JSON-encoded (e.g. '["email@example.com"]')
103+
try:
104+
parsed = json.loads(act_recip_raw)
105+
act_recip = parsed if isinstance(parsed, list) else _parse_recipients(act_recip_raw)
106+
except (json.JSONDecodeError, ValueError):
107+
act_recip = _parse_recipients(act_recip_raw)
103108
elif isinstance(act_recip_raw, list):
104109
act_recip = act_recip_raw
105110
else:

0 commit comments

Comments
 (0)