Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions claude-agent-sdk/listeners/views/app_home_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,27 @@ def build_app_home_view(
],
}
)
else:
blocks.append(
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "\U0001f534 *Slack MCP Server is disconnected.* <https://github.com/slack-samples/bolt-python-support-agent/blob/main/claude-agent-sdk/README.md#slack-mcp-server|Learn how to enable the Slack MCP Server.>",
},
}
)
blocks.append(
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "The Slack MCP Server enables Casey to search messages, read channels, and more.",
}
],
}
)

return {
"type": "home",
Expand Down
8 changes: 5 additions & 3 deletions claude-agent-sdk/tests/test_view_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_build_feedback_blocks():


def test_build_app_home_view_default():
"""Default args (app.py mode) — no MCP status section."""
"""Default args (Socket Mode) — shows disconnected status with learn-more link."""
view = build_app_home_view()

assert view["type"] == "home"
Expand All @@ -35,11 +35,13 @@ def test_build_app_home_view_default():
actions_block = next(b for b in view["blocks"] if b["type"] == "actions")
assert len(actions_block["elements"]) == len(CATEGORIES)

# No MCP status section
# Shows MCP status as disconnected with learn-more link
section_texts = [
b["text"]["text"] for b in view["blocks"] if b["type"] == "section"
]
assert not any("Slack MCP Server" in t for t in section_texts)
mcp_section = next(t for t in section_texts if "Slack MCP Server" in t)
assert "disconnected" in mcp_section
assert "Learn how to enable" in mcp_section


def test_build_app_home_view_connect():
Expand Down
21 changes: 21 additions & 0 deletions openai-agents-sdk/listeners/views/app_home_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,27 @@ def build_app_home_view(
],
}
)
else:
blocks.append(
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "\U0001f534 *Slack MCP Server is disconnected.* <https://github.com/slack-samples/bolt-python-support-agent/blob/main/openai-agents-sdk/README.md#slack-mcp-server|Learn how to enable the Slack MCP Server.>",
},
}
)
blocks.append(
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "The Slack MCP Server enables Casey to search messages, read channels, and more.",
}
],
}
)

return {
"type": "home",
Expand Down
8 changes: 5 additions & 3 deletions openai-agents-sdk/tests/test_view_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_build_feedback_blocks():


def test_build_app_home_view_default():
"""Default args (app.py mode) — no MCP status section."""
"""Default args (Socket Mode) — shows disconnected status with learn-more link."""
view = build_app_home_view()

assert view["type"] == "home"
Expand All @@ -35,11 +35,13 @@ def test_build_app_home_view_default():
actions_block = next(b for b in view["blocks"] if b["type"] == "actions")
assert len(actions_block["elements"]) == len(CATEGORIES)

# No MCP status section
# Shows MCP status as disconnected with learn-more link
section_texts = [
b["text"]["text"] for b in view["blocks"] if b["type"] == "section"
]
assert not any("Slack MCP Server" in t for t in section_texts)
mcp_section = next(t for t in section_texts if "Slack MCP Server" in t)
assert "disconnected" in mcp_section
assert "Learn how to enable" in mcp_section
Comment on lines +42 to +44
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧪 praise: Thanks as always for keeping our tests good @mwbrooks!



def test_build_app_home_view_connect():
Expand Down
21 changes: 21 additions & 0 deletions pydantic-ai/listeners/views/app_home_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,27 @@ def build_app_home_view(
],
}
)
else:
blocks.append(
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "🔴 *Slack MCP Server is disconnected.* <https://github.com/slack-samples/bolt-python-support-agent/blob/main/pydantic-ai/README.md#slack-mcp-server|Learn how to enable the Slack MCP Server.>",
},
}
)
blocks.append(
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "The Slack MCP Server enables Casey to search messages, read channels, and more.",
}
],
}
)

return {
"type": "home",
Expand Down
8 changes: 5 additions & 3 deletions pydantic-ai/tests/test_view_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_build_feedback_blocks():


def test_build_app_home_view_default():
"""Default args (app.py mode) — no MCP status section."""
"""Default args (Socket Mode) — shows disconnected status with learn-more link."""
view = build_app_home_view()

assert view["type"] == "home"
Expand All @@ -35,11 +35,13 @@ def test_build_app_home_view_default():
actions_block = next(b for b in view["blocks"] if b["type"] == "actions")
assert len(actions_block["elements"]) == len(CATEGORIES)

# No MCP status section
# Shows MCP status as disconnected with learn-more link
section_texts = [
b["text"]["text"] for b in view["blocks"] if b["type"] == "section"
]
assert not any("Slack MCP Server" in t for t in section_texts)
mcp_section = next(t for t in section_texts if "Slack MCP Server" in t)
assert "disconnected" in mcp_section
assert "Learn how to enable" in mcp_section


def test_build_app_home_view_connect():
Expand Down