Skip to content

Commit 5510d99

Browse files
committed
Merge branch 'main' into mwbrooks-hardcoded-casey-mention
2 parents f2dcfaa + d44f7ef commit 5510d99

19 files changed

Lines changed: 135 additions & 30 deletions

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ All implementations share the same Slack listener layer, the same five simulated
1818

1919
## What Casey Can Do
2020

21-
Casey gives your team instant IT support through three entry points:
21+
Casey gives your team instant IT support through four entry points:
2222

2323
* **App Home** — Choose from common issue categories. A modal collects details, then Casey starts a DM thread with a resolution.
2424
* **Direct Messages** — Describe any IT issue and Casey responds in-thread, maintaining context across follow-ups.
2525
* **Channel @mentions** — Mention `@Casey` in any channel to get help without leaving the conversation.
26+
* **Assistant Panel** — Users click _Add Agent_ in Slack, select Casey, and pick from suggested prompts or describe an issue.
2627

2728
Behind the scenes, Casey has access to five simulated tools: knowledge base search, support ticket creation, password reset, system status checks, and user permissions lookup.
2829

@@ -32,6 +33,17 @@ Behind the scenes, Casey has access to five simulated tools: knowledge base sear
3233

3334
Casey also works with the [Slack MCP Server](https://docs.slack.dev/agents-ai/model-context-protocol), giving it the ability to search messages and files, read channel history and threads, send messages, schedule messages, and create or update Slack canvases. When deployed with OAuth (HTTP mode), Casey automatically connects to the Slack MCP Server using the user's token, unlocking these capabilities on top of the built-in IT tools.
3435

36+
## Using the App
37+
38+
Once Casey is running, there are several ways to interact:
39+
40+
* **App Home** — Open Casey in Slack and click the _Home_ tab. Choose from common issue categories, describe your issue in the modal, and Casey starts a DM thread with a resolution.
41+
* **Direct Messages** — Open a DM with Casey. Pick a suggested prompt or describe your issue, and Casey will reply in a thread.
42+
* **Channel @mentions** — Invite Casey to a channel by typing `/invite @Casey`, then type `@Casey` followed by your issue. Casey responds in a thread so the channel stays clean.
43+
* **Assistant Panel** — Click _Add Agent_ in the top-right corner of Slack, select Casey, and choose a suggested prompt like _Reset Password_, _Request Access_, or _Network Issues_.
44+
45+
For full setup instructions, pick a framework above and follow the README in that directory.
46+
3547
## Local Development
3648

3749
This repo uses [`slack-bolt`](https://pypi.org/project/slack-bolt/) from PyPI.

claude-agent-sdk/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ Built with [Bolt for Python](https://docs.slack.dev/tools/bolt-python/) and the
66

77
## App Overview
88

9-
Casey gives your team instant IT support through three entry points:
9+
Casey gives your team instant IT support through four entry points:
1010

1111
* **App Home** — Users open Casey's Home tab and choose from common issue categories (Password Reset, Access Request, Software Help, Network Issues, Something Else). A modal collects details, then Casey starts a DM thread with a resolution.
1212
* **Direct Messages** — Users message Casey directly to describe any IT issue. Casey responds in-thread, maintaining context across follow-ups.
1313
* **Channel @mentions** — Users mention `@Casey` in any channel to get help without leaving the conversation.
14+
* **Assistant Panel** — Users click _Add Agent_ in Slack, select Casey, and pick from suggested prompts or describe an issue.
1415

1516
Casey uses five simulated tools to assist users:
1617

@@ -241,13 +242,15 @@ python3 app_oauth.py
241242

242243
### Using the App
243244

244-
Once Casey is running, there are three ways to interact:
245+
Once Casey is running, there are several ways to interact:
245246

246247
**App Home** — Open Casey in Slack and click the _Home_ tab. You'll see five category buttons. Click one to open a modal, describe your issue, and submit. Casey will start a DM thread with you containing a diagnosis and next steps.
247248

248-
**Direct Messages** — Open a DM with Casey and describe your issue. Casey will react with :eyes: while processing, then reply in a thread. Send follow-up messages in the same thread and Casey will maintain the full conversation context.
249+
**Direct Messages** — Open a DM with Casey. You'll see suggested prompts like _Reset Password_, _Request Access_, and _Network Issues_ — pick one or describe your own issue. Casey will react with :eyes: while processing, then reply in a thread. Send follow-up messages in the same thread and Casey will maintain the full conversation context.
249250

250-
**Channel @mentions** — In any channel where Casey has been added, type `@Casey` followed by your issue. Casey responds in a thread so the channel stays clean.
251+
**Channel @mentions** — Invite Casey to a channel by typing `/invite @Casey` in the message box, then type `@Casey` followed by your issue. Casey responds in a thread so the channel stays clean.
252+
253+
**Assistant Panel** — Click _Add Agent_ in the top-right corner of Slack, select Casey from the list, then pick a suggested prompt or type a message.
251254

252255
Casey will add a :white_check_mark: reaction when it believes an issue has been resolved, and occasionally adds a contextual emoji reaction to keep things friendly.
253256

claude-agent-sdk/app_oauth.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import logging
33
import os
44
from pathlib import Path
5+
from urllib.parse import urljoin
56

67
from dotenv import load_dotenv
78
from slack_bolt.async_app import AsyncApp
@@ -120,4 +121,8 @@ async def _authorize_with_fallback_bot_token(
120121

121122
if __name__ == "__main__":
122123
port = int(os.environ.get("PORT", 3000))
124+
redirect_uri = os.environ.get("SLACK_REDIRECT_URI", "")
125+
if redirect_uri:
126+
install_url = urljoin(redirect_uri, "/slack/install")
127+
logger.info("Connect the Slack MCP Server: %s", install_url)
123128
app.start(port=port)

claude-agent-sdk/listeners/views/app_home_builder.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,27 @@ def build_app_home_view(
132132
],
133133
}
134134
)
135+
else:
136+
blocks.append(
137+
{
138+
"type": "section",
139+
"text": {
140+
"type": "mrkdwn",
141+
"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.>",
142+
},
143+
}
144+
)
145+
blocks.append(
146+
{
147+
"type": "context",
148+
"elements": [
149+
{
150+
"type": "mrkdwn",
151+
"text": "The Slack MCP Server enables Casey to search messages, read channels, and more.",
152+
}
153+
],
154+
}
155+
)
135156

136157
return {
137158
"type": "home",

claude-agent-sdk/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ dependencies = [
66
"slack-sdk==3.41.0",
77
"slack-bolt>=1.28.0",
88
"slack-cli-hooks<1.0.0",
9-
"claude-agent-sdk>=0.1.36",
10-
"aiohttp>=3.13.3",
9+
"claude-agent-sdk>=0.1.61",
10+
"aiohttp>=3.13.5",
1111
"python-dotenv==1.2.2",
1212
]
1313

@@ -18,7 +18,7 @@ test = [
1818
]
1919
dev = [
2020
"bolt-python-support-agent-claude[test]",
21-
"ruff==0.15.10",
21+
"ruff==0.15.11",
2222
]
2323

2424
[tool.setuptools.packages.find]

claude-agent-sdk/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ aiohttp>=3.13.3
66
python-dotenv==1.2.2
77

88
pytest
9-
ruff==0.15.10
9+
ruff==0.15.11

claude-agent-sdk/tests/test_view_builders.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_build_feedback_blocks():
2626

2727

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

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

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

4446

4547
def test_build_app_home_view_connect():

openai-agents-sdk/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ Built with [Bolt for Python](https://docs.slack.dev/tools/bolt-python/) and [Ope
66

77
## App Overview
88

9-
Casey gives your team instant IT support through three entry points:
9+
Casey gives your team instant IT support through four entry points:
1010

1111
* **App Home** — Users open Casey's Home tab and choose from common issue categories (Password Reset, Access Request, Software Help, Network Issues, Something Else). A modal collects details, then Casey starts a DM thread with a resolution.
1212
* **Direct Messages** — Users message Casey directly to describe any IT issue. Casey responds in-thread, maintaining context across follow-ups.
1313
* **Channel @mentions** — Users mention `@Casey` in any channel to get help without leaving the conversation.
14+
* **Assistant Panel** — Users click _Add Agent_ in Slack, select Casey, and pick from suggested prompts or describe an issue.
1415

1516
Casey uses five simulated tools to assist users:
1617

@@ -241,13 +242,15 @@ python3 app_oauth.py
241242

242243
### Using the App
243244

244-
Once Casey is running, there are three ways to interact:
245+
Once Casey is running, there are several ways to interact:
245246

246247
**App Home** — Open Casey in Slack and click the _Home_ tab. You'll see five category buttons. Click one to open a modal, describe your issue, and submit. Casey will start a DM thread with you containing a diagnosis and next steps.
247248

248-
**Direct Messages** — Open a DM with Casey and describe your issue. Casey will react with :eyes: while processing, then reply in a thread. Send follow-up messages in the same thread and Casey will maintain the full conversation context.
249+
**Direct Messages** — Open a DM with Casey. You'll see suggested prompts like _Reset Password_, _Request Access_, and _Network Issues_ — pick one or describe your own issue. Casey will react with :eyes: while processing, then reply in a thread. Send follow-up messages in the same thread and Casey will maintain the full conversation context.
249250

250-
**Channel @mentions** — In any channel where Casey has been added, type `@Casey` followed by your issue. Casey responds in a thread so the channel stays clean.
251+
**Channel @mentions** — Invite Casey to a channel by typing `/invite @Casey` in the message box, then type `@Casey` followed by your issue. Casey responds in a thread so the channel stays clean.
252+
253+
**Assistant Panel** — Click _Add Agent_ in the top-right corner of Slack, select Casey from the list, then pick a suggested prompt or type a message.
251254

252255
Casey will add a :white_check_mark: reaction when it believes an issue has been resolved, and occasionally adds a contextual emoji reaction to keep things friendly.
253256

openai-agents-sdk/app_oauth.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import logging
33
import os
44
from pathlib import Path
5+
from urllib.parse import urljoin
56

67
from dotenv import load_dotenv
78
from slack_bolt import App
@@ -120,4 +121,8 @@ def _authorize_with_fallback_bot_token(
120121

121122
if __name__ == "__main__":
122123
port = int(os.environ.get("PORT", 3000))
124+
redirect_uri = os.environ.get("SLACK_REDIRECT_URI", "")
125+
if redirect_uri:
126+
install_url = urljoin(redirect_uri, "/slack/install")
127+
logger.info("Connect the Slack MCP Server: %s", install_url)
123128
app.start(port=port)

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,27 @@ def build_app_home_view(
132132
],
133133
}
134134
)
135+
else:
136+
blocks.append(
137+
{
138+
"type": "section",
139+
"text": {
140+
"type": "mrkdwn",
141+
"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.>",
142+
},
143+
}
144+
)
145+
blocks.append(
146+
{
147+
"type": "context",
148+
"elements": [
149+
{
150+
"type": "mrkdwn",
151+
"text": "The Slack MCP Server enables Casey to search messages, read channels, and more.",
152+
}
153+
],
154+
}
155+
)
135156

136157
return {
137158
"type": "home",

0 commit comments

Comments
 (0)