Skip to content

Commit 371f721

Browse files
committed
fix: use markdown block type instead of mrkdwn for agent responses
Switch response blocks from section+mrkdwn to the markdown block type so that standard Markdown formatting from the LLM renders correctly in Slack. Update tool return values and system prompts to use standard Markdown syntax (e.g. **bold** instead of *bold*).
1 parent afae08e commit 371f721

18 files changed

Lines changed: 44 additions & 62 deletions

openai-agents-sdk/agent/support_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- Confident but honest when you don't know something
2121
2222
## Formatting Rules
23-
- Use Slack mrkdwn syntax: *bold*, _italic_, `code`, ```code blocks```, > blockquotes
23+
- Use standard Markdown syntax: **bold**, _italic_, `code`, ```code blocks```, > blockquotes
2424
- Use bullet points for multi-step instructions
2525
- Keep responses concise — aim for helpful, not verbose
2626
- When referencing ticket IDs or system names, use `inline code`

openai-agents-sdk/agent/tools/knowledge_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ async def search_knowledge_base(
122122
results = []
123123
for article in matches:
124124
results.append(
125-
f"*{article['title']}* ({article['article_id']})\n{article['content']}"
125+
f"**{article['title']}** ({article['article_id']})\n{article['content']}"
126126
)
127127

128128
return "\n\n---\n\n".join(results)

openai-agents-sdk/agent/tools/password_reset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async def trigger_password_reset(
1818
target_user: The username or email of the user whose password should be reset.
1919
"""
2020
return (
21-
f"Password reset initiated for *{target_user}*.\n\n"
21+
f"Password reset initiated for **{target_user}**.\n\n"
2222
f"A reset link has been sent to the email address on file. "
2323
f"The link will expire in 30 minutes.\n\n"
2424
f"_If the user doesn't receive the email within 5 minutes, "

openai-agents-sdk/agent/tools/system_status.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async def check_system_status(
7676
}.get(info["status"], ":white_circle:")
7777

7878
return (
79-
f"*{info['name']}* {status_emoji} `{info['status'].upper()}`\n"
79+
f"**{info['name']}** {status_emoji} `{info['status'].upper()}`\n"
8080
f"{info['details']}"
8181
)
8282

openai-agents-sdk/agent/tools/ticket.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ async def create_support_ticket(
2929

3030
return (
3131
f"Support ticket created successfully.\n"
32-
f"*Ticket ID:* {ticket_id}\n"
33-
f"*Title:* {title}\n"
34-
f"*Priority:* {priority}\n"
35-
f"*Category:* {category}\n"
36-
f"*Status:* Open\n"
37-
f"*Assigned to:* IT Support Queue\n\n"
32+
f"**Ticket ID:** {ticket_id}\n"
33+
f"**Title:** {title}\n"
34+
f"**Priority:** {priority}\n"
35+
f"**Category:** {category}\n"
36+
f"**Status:** Open\n"
37+
f"**Assigned to:** IT Support Queue\n\n"
3838
f"The IT team will review this ticket and follow up within the SLA for {priority} priority issues."
3939
)

openai-agents-sdk/agent/tools/user_permissions.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ async def lookup_user_permissions(
1818
system: The system or resource to check permissions for (e.g., 'github', 'jira', 'aws').
1919
"""
2020
return (
21-
f"*Permissions for {target_user} on {system}:*\n\n"
22-
f"*Groups:* `{system}-users`, `{system}-readonly`\n"
23-
f"*Access Level:* Standard User\n"
24-
f"*Last Login:* 2 hours ago\n"
25-
f"*Account Status:* Active\n"
26-
f"*MFA Enabled:* Yes\n\n"
21+
f"**Permissions for {target_user} on {system}:**\n\n"
22+
f"**Groups:** `{system}-users`, `{system}-readonly`\n"
23+
f"**Access Level:** Standard User\n"
24+
f"**Last Login:** 2 hours ago\n"
25+
f"**Account Status:** Active\n"
26+
f"**MFA Enabled:** Yes\n\n"
2727
f"_To request elevated access, the user's manager must submit an access request "
2828
f"through the IT portal._"
2929
)

openai-agents-sdk/listeners/events/app_mentioned.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,8 @@ def handle_app_mentioned(client: WebClient, event: dict, logger: Logger, say: Sa
8383
feedback_blocks = create_feedback_block()
8484
response_blocks = [
8585
{
86-
"type": "section",
87-
"text": {
88-
"type": "mrkdwn",
89-
"text": result.final_output,
90-
},
86+
"type": "markdown",
87+
"text": result.final_output,
9188
},
9289
*feedback_blocks,
9390
]

openai-agents-sdk/listeners/events/message_im.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,8 @@ def handle_message_im(client: WebClient, event: dict, logger: Logger, say: Say):
8181
feedback_blocks = create_feedback_block()
8282
response_blocks = [
8383
{
84-
"type": "section",
85-
"text": {
86-
"type": "mrkdwn",
87-
"text": result.final_output,
88-
},
84+
"type": "markdown",
85+
"text": result.final_output,
8986
},
9087
*feedback_blocks,
9188
]

openai-agents-sdk/listeners/views/issue_modal.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,8 @@ def handle_issue_submission(ack: Ack, body: dict, client: WebClient, logger: Log
6767
feedback_blocks = create_feedback_block()
6868
response_blocks = [
6969
{
70-
"type": "section",
71-
"text": {
72-
"type": "mrkdwn",
73-
"text": result.final_output,
74-
},
70+
"type": "markdown",
71+
"text": result.final_output,
7572
},
7673
*feedback_blocks,
7774
]

pydantic-ai/agent/casey.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- Confident but honest when you don't know something
2121
2222
## Formatting Rules
23-
- Use Slack mrkdwn syntax: *bold*, _italic_, `code`, ```code blocks```, > blockquotes
23+
- Use standard Markdown syntax: **bold**, _italic_, `code`, ```code blocks```, > blockquotes
2424
- Use bullet points for multi-step instructions
2525
- Keep responses concise — aim for helpful, not verbose
2626
- When referencing ticket IDs or system names, use `inline code`

0 commit comments

Comments
 (0)