Build interactive card
If service_name is provided, use the service-aware card:
{
"config": {"wide_screen_mode": true},
"header": {
"title": {"tag": "plain_text", "content": "🛠️ {service_name} Bug 自动修复完成"},
"template": "red"
},
"elements": [
{
"tag": "div",
"text": {"tag": "lark_md", "content": "**Service:** {service_name}\n**Summary:**\n{summary}"}
},
{
"tag": "div",
"text": {"tag": "lark_md", "content": "**Traceback:**\n```{traceback_preview_truncated}```"}
},
{
"tag": "action",
"actions": [
{
"tag": "button",
"text": {"tag": "plain_text", "content": "查看 PR / Review"},
"url": "{pr_url}",
"type": "primary"
}
]
}
]
}
The traceback section should be omitted if traceback_preview is empty.
The diff_preview can be added as an additional section if provided.
If service_name is not provided, use the legacy card format:
{
"config": {"wide_screen_mode": true},
"header": {
"title": {"tag": "plain_text", "content": "🛠️ Bug 自动修复完成"},
"template": "red"
},
"elements": [
{
"tag": "div",
"text": {"tag": "lark_md", "content": "**Bug Summary**\n{summary}"}
},
{
"tag": "action",
"actions": [
{
"tag": "button",
"text": {"tag": "plain_text", "content": "查看 PR"},
"url": "{pr_url}",
"type": "primary"
}
]
}
]
}