From 1f11194a9cb239df51da084c9e3495dab8394ab2 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Wed, 19 Aug 2026 23:05:03 -0700 Subject: [PATCH 01/11] feat(methods): add agents.sessions method examples Add examples for agents.sessions.setStatus and agents.sessions.rename with a minimal assistant:write manifest and the standard .slack CLI hooks. Co-Authored-By: Claude --- methods/README.md | 5 ++++ methods/src/agents_sessions/.slack/.gitignore | 2 ++ .../src/agents_sessions/.slack/config.json | 6 +++++ methods/src/agents_sessions/.slack/hooks.json | 5 ++++ methods/src/agents_sessions/__init__.py | 0 .../agents_sessions/agents_sessions_rename.py | 18 +++++++++++++ .../agents_sessions_set_status.py | 18 +++++++++++++ methods/src/agents_sessions/manifest.json | 25 +++++++++++++++++++ 8 files changed, 79 insertions(+) create mode 100644 methods/src/agents_sessions/.slack/.gitignore create mode 100644 methods/src/agents_sessions/.slack/config.json create mode 100644 methods/src/agents_sessions/.slack/hooks.json create mode 100644 methods/src/agents_sessions/__init__.py create mode 100644 methods/src/agents_sessions/agents_sessions_rename.py create mode 100644 methods/src/agents_sessions/agents_sessions_set_status.py create mode 100644 methods/src/agents_sessions/manifest.json diff --git a/methods/README.md b/methods/README.md index 5d6b815..7969f8d 100644 --- a/methods/README.md +++ b/methods/README.md @@ -16,6 +16,11 @@ $ slack run chat_post_message # Make the request ## What's on call +### agents.sessions + +- **[agents.sessions.rename](https://docs.slack.dev/reference/methods/agents.sessions.rename)**: Renames an agent session. [Implementation](./src/agents_sessions/agents_sessions_rename.py). +- **[agents.sessions.setStatus](https://docs.slack.dev/reference/methods/agents.sessions.setStatus)**: Sets the lifecycle status of an agent session, creating the session if it does not already exist. [Implementation](./src/agents_sessions/agents_sessions_set_status.py). + ### chat - **[chat.postMessage](https://docs.slack.dev/reference/methods/chat.postmessage)**: Sends a message to a channel. [Implementation](./src/chat/chat_post_message.py). diff --git a/methods/src/agents_sessions/.slack/.gitignore b/methods/src/agents_sessions/.slack/.gitignore new file mode 100644 index 0000000..973ba60 --- /dev/null +++ b/methods/src/agents_sessions/.slack/.gitignore @@ -0,0 +1,2 @@ +apps.dev.json +cache/ diff --git a/methods/src/agents_sessions/.slack/config.json b/methods/src/agents_sessions/.slack/config.json new file mode 100644 index 0000000..909afbe --- /dev/null +++ b/methods/src/agents_sessions/.slack/config.json @@ -0,0 +1,6 @@ +{ + "manifest": { + "source": "local" + }, + "project_id": "00000000-0000-0000-0000-000000000000" +} diff --git a/methods/src/agents_sessions/.slack/hooks.json b/methods/src/agents_sessions/.slack/hooks.json new file mode 100644 index 0000000..ce474c9 --- /dev/null +++ b/methods/src/agents_sessions/.slack/hooks.json @@ -0,0 +1,5 @@ +{ + "hooks": { + "get-hooks": "python3 -m slack_cli_hooks.hooks.get_hooks" + } +} diff --git a/methods/src/agents_sessions/__init__.py b/methods/src/agents_sessions/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/methods/src/agents_sessions/agents_sessions_rename.py b/methods/src/agents_sessions/agents_sessions_rename.py new file mode 100644 index 0000000..c173a23 --- /dev/null +++ b/methods/src/agents_sessions/agents_sessions_rename.py @@ -0,0 +1,18 @@ +import os + +from slack_sdk import WebClient + +# Read a token from an environment variable +token = os.environ.get("SLACK_TOKEN") + +# Initialize +client = WebClient(token=token) + +# Call the agents.sessions.rename method +response = client.agents_sessions_rename( + channel_id="C123ABC456", + title="Fix flaky login test", +) + +# Inspect the response +print(response) diff --git a/methods/src/agents_sessions/agents_sessions_set_status.py b/methods/src/agents_sessions/agents_sessions_set_status.py new file mode 100644 index 0000000..5a6d1f3 --- /dev/null +++ b/methods/src/agents_sessions/agents_sessions_set_status.py @@ -0,0 +1,18 @@ +import os + +from slack_sdk import WebClient + +# Read a token from an environment variable +token = os.environ.get("SLACK_TOKEN") + +# Initialize +client = WebClient(token=token) + +# Call the agents.sessions.setStatus method +response = client.agents_sessions_setStatus( + channel_id="C123ABC456", + status="processing", +) + +# Inspect the response +print(response) diff --git a/methods/src/agents_sessions/manifest.json b/methods/src/agents_sessions/manifest.json new file mode 100644 index 0000000..3efbd1b --- /dev/null +++ b/methods/src/agents_sessions/manifest.json @@ -0,0 +1,25 @@ +{ + "display_information": { + "name": "Slack API Methods", + "description": "Example implementations to call \"agents.sessions\" methods" + }, + "features": { + "bot_user": { + "display_name": "Slack API Methods", + "always_online": true + }, + "agent_view": { + "enabled": true + } + }, + "oauth_config": { + "scopes": { + "bot": ["assistant:write"] + } + }, + "settings": { + "org_deploy_enabled": true, + "socket_mode_enabled": false, + "token_rotation_enabled": false + } +} From 67d25e02716d51aac6057ee084fc6a1815062a72 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Wed, 19 Aug 2026 23:05:49 -0700 Subject: [PATCH 02/11] feat(methods): add codeChannels method examples Add examples for the codeChannels.* methods with a minimal code_channels:manage manifest and the standard .slack CLI hooks. Stacked on the agents.sessions examples. Co-Authored-By: Claude --- methods/README.md | 13 +++++++++ methods/src/code_channels/.slack/.gitignore | 2 ++ methods/src/code_channels/.slack/config.json | 6 +++++ methods/src/code_channels/.slack/hooks.json | 5 ++++ methods/src/code_channels/__init__.py | 0 .../code_channels/code_channels_archive.py | 18 +++++++++++++ .../src/code_channels/code_channels_create.py | 19 +++++++++++++ .../code_channels/code_channels_get_canvas.py | 18 +++++++++++++ .../code_channels/code_channels_list_views.py | 17 ++++++++++++ .../code_channels_remove_view.py | 18 +++++++++++++ .../src/code_channels/code_channels_rename.py | 18 +++++++++++++ .../code_channels_set_canvas_content.py | 19 +++++++++++++ .../code_channels_set_commands.py | 27 +++++++++++++++++++ .../code_channels_set_properties.py | 27 +++++++++++++++++++ .../code_channels/code_channels_set_view.py | 21 +++++++++++++++ methods/src/code_channels/manifest.json | 25 +++++++++++++++++ 16 files changed, 253 insertions(+) create mode 100644 methods/src/code_channels/.slack/.gitignore create mode 100644 methods/src/code_channels/.slack/config.json create mode 100644 methods/src/code_channels/.slack/hooks.json create mode 100644 methods/src/code_channels/__init__.py create mode 100644 methods/src/code_channels/code_channels_archive.py create mode 100644 methods/src/code_channels/code_channels_create.py create mode 100644 methods/src/code_channels/code_channels_get_canvas.py create mode 100644 methods/src/code_channels/code_channels_list_views.py create mode 100644 methods/src/code_channels/code_channels_remove_view.py create mode 100644 methods/src/code_channels/code_channels_rename.py create mode 100644 methods/src/code_channels/code_channels_set_canvas_content.py create mode 100644 methods/src/code_channels/code_channels_set_commands.py create mode 100644 methods/src/code_channels/code_channels_set_properties.py create mode 100644 methods/src/code_channels/code_channels_set_view.py create mode 100644 methods/src/code_channels/manifest.json diff --git a/methods/README.md b/methods/README.md index 7969f8d..777bcef 100644 --- a/methods/README.md +++ b/methods/README.md @@ -24,3 +24,16 @@ $ slack run chat_post_message # Make the request ### chat - **[chat.postMessage](https://docs.slack.dev/reference/methods/chat.postmessage)**: Sends a message to a channel. [Implementation](./src/chat/chat_post_message.py). + +### codeChannels + +- **[codeChannels.archive](https://docs.slack.dev/reference/methods/codeChannels.archive)**: Archives a code channel, optionally recording a summary message on the channel. [Implementation](./src/code_channels/code_channels_archive.py). +- **[codeChannels.create](https://docs.slack.dev/reference/methods/codeChannels.create)**: Creates a dedicated code channel for an agent session. [Implementation](./src/code_channels/code_channels_create.py). +- **[codeChannels.getCanvas](https://docs.slack.dev/reference/methods/codeChannels.getCanvas)**: Fetches a canvas attached to a code channel — full content plus comment threads — in a single round-trip. [Implementation](./src/code_channels/code_channels_get_canvas.py). +- **[codeChannels.listViews](https://docs.slack.dev/reference/methods/codeChannels.listViews)**: Lists the view tabs attached to a code channel. [Implementation](./src/code_channels/code_channels_list_views.py). +- **[codeChannels.removeView](https://docs.slack.dev/reference/methods/codeChannels.removeView)**: Removes a view from a code channel. [Implementation](./src/code_channels/code_channels_remove_view.py). +- **[codeChannels.rename](https://docs.slack.dev/reference/methods/codeChannels.rename)**: Renames a code channel. [Implementation](./src/code_channels/code_channels_rename.py). +- **[codeChannels.setCanvasContent](https://docs.slack.dev/reference/methods/codeChannels.setCanvasContent)**: Replaces the full markdown content of a canvas attached to a code channel, preserving the comment threads on the sections your agent didn't change. [Implementation](./src/code_channels/code_channels_set_canvas_content.py). +- **[codeChannels.setCommands](https://docs.slack.dev/reference/methods/codeChannels.setCommands)**: Registers the set of slash commands your agent offers in a code channel. [Implementation](./src/code_channels/code_channels_set_commands.py). +- **[codeChannels.setProperties](https://docs.slack.dev/reference/methods/codeChannels.setProperties)**: Sets properties on a code channel: context bar items and external resource details. [Implementation](./src/code_channels/code_channels_set_properties.py). +- **[codeChannels.setView](https://docs.slack.dev/reference/methods/codeChannels.setView)**: Creates or updates a view in a code channel. Views can render HTML, diffs, Block Kit, or canvases as tabs alongside the conversation. [Implementation](./src/code_channels/code_channels_set_view.py). diff --git a/methods/src/code_channels/.slack/.gitignore b/methods/src/code_channels/.slack/.gitignore new file mode 100644 index 0000000..973ba60 --- /dev/null +++ b/methods/src/code_channels/.slack/.gitignore @@ -0,0 +1,2 @@ +apps.dev.json +cache/ diff --git a/methods/src/code_channels/.slack/config.json b/methods/src/code_channels/.slack/config.json new file mode 100644 index 0000000..909afbe --- /dev/null +++ b/methods/src/code_channels/.slack/config.json @@ -0,0 +1,6 @@ +{ + "manifest": { + "source": "local" + }, + "project_id": "00000000-0000-0000-0000-000000000000" +} diff --git a/methods/src/code_channels/.slack/hooks.json b/methods/src/code_channels/.slack/hooks.json new file mode 100644 index 0000000..ce474c9 --- /dev/null +++ b/methods/src/code_channels/.slack/hooks.json @@ -0,0 +1,5 @@ +{ + "hooks": { + "get-hooks": "python3 -m slack_cli_hooks.hooks.get_hooks" + } +} diff --git a/methods/src/code_channels/__init__.py b/methods/src/code_channels/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/methods/src/code_channels/code_channels_archive.py b/methods/src/code_channels/code_channels_archive.py new file mode 100644 index 0000000..338ae1e --- /dev/null +++ b/methods/src/code_channels/code_channels_archive.py @@ -0,0 +1,18 @@ +import os + +from slack_sdk import WebClient + +# Read a token from an environment variable +token = os.environ.get("SLACK_TOKEN") + +# Initialize +client = WebClient(token=token) + +# Call the codeChannels.archive method +response = client.codeChannels_archive( + channel_id="C123ABC456", + summary_message_ts="1717171717.123456", +) + +# Inspect the response +print(response) diff --git a/methods/src/code_channels/code_channels_create.py b/methods/src/code_channels/code_channels_create.py new file mode 100644 index 0000000..1f5c02a --- /dev/null +++ b/methods/src/code_channels/code_channels_create.py @@ -0,0 +1,19 @@ +import os + +from slack_sdk import WebClient + +# Read a token from an environment variable +token = os.environ.get("SLACK_TOKEN") + +# Initialize +client = WebClient(token=token) + +# Call the codeChannels.create method +response = client.codeChannels_create( + name="Fix flaky login test", + origin_channel_id="C123ABC456", + origin_message_ts="1717171717.123456", +) + +# Inspect the response +print(response) diff --git a/methods/src/code_channels/code_channels_get_canvas.py b/methods/src/code_channels/code_channels_get_canvas.py new file mode 100644 index 0000000..016d0aa --- /dev/null +++ b/methods/src/code_channels/code_channels_get_canvas.py @@ -0,0 +1,18 @@ +import os + +from slack_sdk import WebClient + +# Read a token from an environment variable +token = os.environ.get("SLACK_TOKEN") + +# Initialize +client = WebClient(token=token) + +# Call the codeChannels.getCanvas method +response = client.codeChannels_getCanvas( + channel_id="C123ABC456", + canvas_id="F123ABC456", +) + +# Inspect the response +print(response) diff --git a/methods/src/code_channels/code_channels_list_views.py b/methods/src/code_channels/code_channels_list_views.py new file mode 100644 index 0000000..928d18d --- /dev/null +++ b/methods/src/code_channels/code_channels_list_views.py @@ -0,0 +1,17 @@ +import os + +from slack_sdk import WebClient + +# Read a token from an environment variable +token = os.environ.get("SLACK_TOKEN") + +# Initialize +client = WebClient(token=token) + +# Call the codeChannels.listViews method +response = client.codeChannels_listViews( + channel_id="C123ABC456", +) + +# Inspect the response +print(response) diff --git a/methods/src/code_channels/code_channels_remove_view.py b/methods/src/code_channels/code_channels_remove_view.py new file mode 100644 index 0000000..f8101a6 --- /dev/null +++ b/methods/src/code_channels/code_channels_remove_view.py @@ -0,0 +1,18 @@ +import os + +from slack_sdk import WebClient + +# Read a token from an environment variable +token = os.environ.get("SLACK_TOKEN") + +# Initialize +client = WebClient(token=token) + +# Call the codeChannels.removeView method +response = client.codeChannels_removeView( + channel_id="C123ABC456", + view_id="V123ABC456", +) + +# Inspect the response +print(response) diff --git a/methods/src/code_channels/code_channels_rename.py b/methods/src/code_channels/code_channels_rename.py new file mode 100644 index 0000000..097d446 --- /dev/null +++ b/methods/src/code_channels/code_channels_rename.py @@ -0,0 +1,18 @@ +import os + +from slack_sdk import WebClient + +# Read a token from an environment variable +token = os.environ.get("SLACK_TOKEN") + +# Initialize +client = WebClient(token=token) + +# Call the codeChannels.rename method +response = client.codeChannels_rename( + channel_id="C123ABC456", + name="Fix flaky login test v2", +) + +# Inspect the response +print(response) diff --git a/methods/src/code_channels/code_channels_set_canvas_content.py b/methods/src/code_channels/code_channels_set_canvas_content.py new file mode 100644 index 0000000..ea3e365 --- /dev/null +++ b/methods/src/code_channels/code_channels_set_canvas_content.py @@ -0,0 +1,19 @@ +import os + +from slack_sdk import WebClient + +# Read a token from an environment variable +token = os.environ.get("SLACK_TOKEN") + +# Initialize +client = WebClient(token=token) + +# Call the codeChannels.setCanvasContent method +response = client.codeChannels_setCanvasContent( + channel_id="C123ABC456", + canvas_id="F123ABC456", + content="# Plan\n\n1. Reproduce the flaky test\n2. Fix the race\n3. Verify", +) + +# Inspect the response +print(response) diff --git a/methods/src/code_channels/code_channels_set_commands.py b/methods/src/code_channels/code_channels_set_commands.py new file mode 100644 index 0000000..0abe872 --- /dev/null +++ b/methods/src/code_channels/code_channels_set_commands.py @@ -0,0 +1,27 @@ +import os + +from slack_sdk import WebClient + +# Read a token from an environment variable +token = os.environ.get("SLACK_TOKEN") + +# Initialize +client = WebClient(token=token) + +# Call the codeChannels.setCommands method +response = client.codeChannels_setCommands( + channel_id="C123ABC456", + commands=[ + { + "name": "test", + "description": "Run the test suite", + }, + { + "name": "diff", + "description": "Show the current diff", + }, + ], +) + +# Inspect the response +print(response) diff --git a/methods/src/code_channels/code_channels_set_properties.py b/methods/src/code_channels/code_channels_set_properties.py new file mode 100644 index 0000000..71219f8 --- /dev/null +++ b/methods/src/code_channels/code_channels_set_properties.py @@ -0,0 +1,27 @@ +import os + +from slack_sdk import WebClient + +# Read a token from an environment variable +token = os.environ.get("SLACK_TOKEN") + +# Initialize +client = WebClient(token=token) + +# Call the codeChannels.setProperties method +response = client.codeChannels_setProperties( + channel_id="C123ABC456", + code_channel={ + "context_bar_items": [ + { + "key": "repo", + "label": "acme/billing", + "icon": "folder", + "url": "https://github.com/acme/billing", + }, + ] + }, +) + +# Inspect the response +print(response) diff --git a/methods/src/code_channels/code_channels_set_view.py b/methods/src/code_channels/code_channels_set_view.py new file mode 100644 index 0000000..98fffa7 --- /dev/null +++ b/methods/src/code_channels/code_channels_set_view.py @@ -0,0 +1,21 @@ +import os + +from slack_sdk import WebClient + +# Read a token from an environment variable +token = os.environ.get("SLACK_TOKEN") + +# Initialize +client = WebClient(token=token) + +# Call the codeChannels.setView method +response = client.codeChannels_setView( + channel_id="C123ABC456", + type="diff", + content="diff --git a/cron.py b/cron.py\n--- a/cron.py\n+++ b/cron.py\n@@ ...", + base_branch="main", + head_branch="agent/migrate-cron", +) + +# Inspect the response +print(response) diff --git a/methods/src/code_channels/manifest.json b/methods/src/code_channels/manifest.json new file mode 100644 index 0000000..3c0f74d --- /dev/null +++ b/methods/src/code_channels/manifest.json @@ -0,0 +1,25 @@ +{ + "display_information": { + "name": "Slack API Methods", + "description": "Example implementations to call \"codeChannels\" methods" + }, + "features": { + "bot_user": { + "display_name": "Slack API Methods", + "always_online": true + }, + "code_channels": { + "enabled": true + } + }, + "oauth_config": { + "scopes": { + "bot": ["code_channels:manage"] + } + }, + "settings": { + "org_deploy_enabled": true, + "socket_mode_enabled": false, + "token_rotation_enabled": false + } +} From d16b8c2ee3fce9d2839ad5202e9197ea77718440 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Wed, 19 Aug 2026 23:32:27 -0700 Subject: [PATCH 03/11] docs(methods): use `agents` section header and concise descriptions Match the family-first header convention (### agents, like ### chat) and tighten the agents.sessions.* method descriptions. Co-Authored-By: Claude --- methods/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/methods/README.md b/methods/README.md index 7969f8d..4b439c3 100644 --- a/methods/README.md +++ b/methods/README.md @@ -16,10 +16,10 @@ $ slack run chat_post_message # Make the request ## What's on call -### agents.sessions +### agents -- **[agents.sessions.rename](https://docs.slack.dev/reference/methods/agents.sessions.rename)**: Renames an agent session. [Implementation](./src/agents_sessions/agents_sessions_rename.py). -- **[agents.sessions.setStatus](https://docs.slack.dev/reference/methods/agents.sessions.setStatus)**: Sets the lifecycle status of an agent session, creating the session if it does not already exist. [Implementation](./src/agents_sessions/agents_sessions_set_status.py). +- **[agents.sessions.rename](https://docs.slack.dev/reference/methods/agents.sessions.rename)**: Rename an agent session. [Implementation](./src/agents_sessions/agents_sessions_rename.py). +- **[agents.sessions.setStatus](https://docs.slack.dev/reference/methods/agents.sessions.setStatus)**: Set an agent session's lifecycle status, creating the session if needed. [Implementation](./src/agents_sessions/agents_sessions_set_status.py). ### chat From 3356acc495404fb496a7d4125baf5ad8abd88fca Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Wed, 19 Aug 2026 23:34:39 -0700 Subject: [PATCH 04/11] fix(methods): use chat:write scope for agents.sessions example agents.sessions.setStatus and agents.sessions.rename require the chat:write bot scope per the method reference, not assistant:write. Co-Authored-By: Claude --- methods/src/agents_sessions/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/methods/src/agents_sessions/manifest.json b/methods/src/agents_sessions/manifest.json index 3efbd1b..df2c5e1 100644 --- a/methods/src/agents_sessions/manifest.json +++ b/methods/src/agents_sessions/manifest.json @@ -14,7 +14,7 @@ }, "oauth_config": { "scopes": { - "bot": ["assistant:write"] + "bot": ["chat:write"] } }, "settings": { From 13a1d6c1f0da1f6ac04f5e4a09c93fb759fe1306 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Wed, 19 Aug 2026 23:43:18 -0700 Subject: [PATCH 05/11] refactor(methods): nest agents.sessions example under agents/sessions/ Move the agents.sessions method examples from a flat agents_sessions/ dir to nested agents/sessions/ (path mirrors the agents.sessions.* method family), updating the README implementation links. Co-Authored-By: Claude --- methods/README.md | 4 ++-- methods/src/{agents_sessions => agents}/__init__.py | 0 .../{agents_sessions => agents/sessions}/.slack/.gitignore | 0 .../{agents_sessions => agents/sessions}/.slack/config.json | 0 .../{agents_sessions => agents/sessions}/.slack/hooks.json | 0 methods/src/agents/sessions/__init__.py | 0 .../sessions}/agents_sessions_rename.py | 0 .../sessions}/agents_sessions_set_status.py | 0 .../src/{agents_sessions => agents/sessions}/manifest.json | 0 9 files changed, 2 insertions(+), 2 deletions(-) rename methods/src/{agents_sessions => agents}/__init__.py (100%) rename methods/src/{agents_sessions => agents/sessions}/.slack/.gitignore (100%) rename methods/src/{agents_sessions => agents/sessions}/.slack/config.json (100%) rename methods/src/{agents_sessions => agents/sessions}/.slack/hooks.json (100%) create mode 100644 methods/src/agents/sessions/__init__.py rename methods/src/{agents_sessions => agents/sessions}/agents_sessions_rename.py (100%) rename methods/src/{agents_sessions => agents/sessions}/agents_sessions_set_status.py (100%) rename methods/src/{agents_sessions => agents/sessions}/manifest.json (100%) diff --git a/methods/README.md b/methods/README.md index 4b439c3..f6c51bb 100644 --- a/methods/README.md +++ b/methods/README.md @@ -18,8 +18,8 @@ $ slack run chat_post_message # Make the request ### agents -- **[agents.sessions.rename](https://docs.slack.dev/reference/methods/agents.sessions.rename)**: Rename an agent session. [Implementation](./src/agents_sessions/agents_sessions_rename.py). -- **[agents.sessions.setStatus](https://docs.slack.dev/reference/methods/agents.sessions.setStatus)**: Set an agent session's lifecycle status, creating the session if needed. [Implementation](./src/agents_sessions/agents_sessions_set_status.py). +- **[agents.sessions.rename](https://docs.slack.dev/reference/methods/agents.sessions.rename)**: Rename an agent session. [Implementation](./src/agents/sessions/agents_sessions_rename.py). +- **[agents.sessions.setStatus](https://docs.slack.dev/reference/methods/agents.sessions.setStatus)**: Set an agent session's lifecycle status, creating the session if needed. [Implementation](./src/agents/sessions/agents_sessions_set_status.py). ### chat diff --git a/methods/src/agents_sessions/__init__.py b/methods/src/agents/__init__.py similarity index 100% rename from methods/src/agents_sessions/__init__.py rename to methods/src/agents/__init__.py diff --git a/methods/src/agents_sessions/.slack/.gitignore b/methods/src/agents/sessions/.slack/.gitignore similarity index 100% rename from methods/src/agents_sessions/.slack/.gitignore rename to methods/src/agents/sessions/.slack/.gitignore diff --git a/methods/src/agents_sessions/.slack/config.json b/methods/src/agents/sessions/.slack/config.json similarity index 100% rename from methods/src/agents_sessions/.slack/config.json rename to methods/src/agents/sessions/.slack/config.json diff --git a/methods/src/agents_sessions/.slack/hooks.json b/methods/src/agents/sessions/.slack/hooks.json similarity index 100% rename from methods/src/agents_sessions/.slack/hooks.json rename to methods/src/agents/sessions/.slack/hooks.json diff --git a/methods/src/agents/sessions/__init__.py b/methods/src/agents/sessions/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/methods/src/agents_sessions/agents_sessions_rename.py b/methods/src/agents/sessions/agents_sessions_rename.py similarity index 100% rename from methods/src/agents_sessions/agents_sessions_rename.py rename to methods/src/agents/sessions/agents_sessions_rename.py diff --git a/methods/src/agents_sessions/agents_sessions_set_status.py b/methods/src/agents/sessions/agents_sessions_set_status.py similarity index 100% rename from methods/src/agents_sessions/agents_sessions_set_status.py rename to methods/src/agents/sessions/agents_sessions_set_status.py diff --git a/methods/src/agents_sessions/manifest.json b/methods/src/agents/sessions/manifest.json similarity index 100% rename from methods/src/agents_sessions/manifest.json rename to methods/src/agents/sessions/manifest.json From 2df47f6ba15b1360ecfd5bf5a0f123088450d5b8 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Thu, 20 Aug 2026 00:22:18 -0700 Subject: [PATCH 06/11] feat(methods): make agents.sessions example manifest a well-formed agent Add the recommended agent_view event subscriptions (agent_session_stopped, app_home_opened, message.im), the assistant:write scope, and im:history so message.im events deliver; enable socket mode. Clears the manifest recommendations and the agent_session_stopped subscription warning. Co-Authored-By: Claude --- methods/src/agents/sessions/manifest.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/methods/src/agents/sessions/manifest.json b/methods/src/agents/sessions/manifest.json index df2c5e1..e24921a 100644 --- a/methods/src/agents/sessions/manifest.json +++ b/methods/src/agents/sessions/manifest.json @@ -14,12 +14,15 @@ }, "oauth_config": { "scopes": { - "bot": ["chat:write"] + "bot": ["assistant:write", "chat:write", "im:history"] } }, "settings": { + "event_subscriptions": { + "bot_events": ["agent_session_stopped", "app_home_opened", "message.im"] + }, "org_deploy_enabled": true, - "socket_mode_enabled": false, + "socket_mode_enabled": true, "token_rotation_enabled": false } } From 3d664a0744522079180c122980d4b4be654e7770 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Wed, 23 Sep 2026 16:18:32 -0700 Subject: [PATCH 07/11] refactor(methods): rename codeChannels examples to agents.conversations.* MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Decision (2026-09-23): ship agents.conversations.* only — no legacy codeChannels.* method names. Renames methods/src/code_channels/ -> methods/src/agents/conversations/, updates each example's method call (client.agents_conversations_*), aligns args to the SDK #1943 signatures (getCanvas/setCanvasContent take channel, not channel_id), drops the rename example (agents.sessions.rename, covered by #201), and updates the manifest description + methods/README. The features.code_channels manifest feature and code_channels:manage scope are unchanged — only method names moved. Co-Authored-By: Claude Co-Authored-By: Claude Opus 4.8 (1M context) --- methods/README.md | 22 ++++++++----------- .../conversations}/.slack/.gitignore | 0 .../conversations}/.slack/config.json | 0 .../conversations}/.slack/hooks.json | 0 .../conversations}/__init__.py | 0 .../agents_conversations_archive.py} | 4 ++-- .../agents_conversations_create.py} | 4 ++-- .../agents_conversations_get_canvas.py} | 6 ++--- .../agents_conversations_list_views.py} | 4 ++-- .../agents_conversations_remove_view.py} | 4 ++-- ...gents_conversations_set_canvas_content.py} | 6 ++--- .../agents_conversations_set_commands.py} | 4 ++-- .../agents_conversations_set_properties.py} | 4 ++-- .../agents_conversations_set_view.py} | 4 ++-- .../conversations}/manifest.json | 2 +- .../src/code_channels/code_channels_rename.py | 18 --------------- 16 files changed, 30 insertions(+), 52 deletions(-) rename methods/src/{code_channels => agents/conversations}/.slack/.gitignore (100%) rename methods/src/{code_channels => agents/conversations}/.slack/config.json (100%) rename methods/src/{code_channels => agents/conversations}/.slack/hooks.json (100%) rename methods/src/{code_channels => agents/conversations}/__init__.py (100%) rename methods/src/{code_channels/code_channels_archive.py => agents/conversations/agents_conversations_archive.py} (75%) rename methods/src/{code_channels/code_channels_create.py => agents/conversations/agents_conversations_create.py} (77%) rename methods/src/{code_channels/code_channels_get_canvas.py => agents/conversations/agents_conversations_get_canvas.py} (66%) rename methods/src/{code_channels/code_channels_list_views.py => agents/conversations/agents_conversations_list_views.py} (71%) rename methods/src/{code_channels/code_channels_remove_view.py => agents/conversations/agents_conversations_remove_view.py} (72%) rename methods/src/{code_channels/code_channels_set_canvas_content.py => agents/conversations/agents_conversations_set_canvas_content.py} (69%) rename methods/src/{code_channels/code_channels_set_commands.py => agents/conversations/agents_conversations_set_commands.py} (81%) rename methods/src/{code_channels/code_channels_set_properties.py => agents/conversations/agents_conversations_set_properties.py} (82%) rename methods/src/{code_channels/code_channels_set_view.py => agents/conversations/agents_conversations_set_view.py} (81%) rename methods/src/{code_channels => agents/conversations}/manifest.json (83%) delete mode 100644 methods/src/code_channels/code_channels_rename.py diff --git a/methods/README.md b/methods/README.md index 2fbb90b..e8cd8e0 100644 --- a/methods/README.md +++ b/methods/README.md @@ -18,22 +18,18 @@ $ slack run chat_post_message.py # Make the request ### agents +- **[agents.conversations.archive](https://docs.slack.dev/reference/methods/agents.conversations.archive)**: Archives a code channel, optionally recording a summary message on the channel. [Implementation](./src/agents/conversations/agents_conversations_archive.py). +- **[agents.conversations.create](https://docs.slack.dev/reference/methods/agents.conversations.create)**: Creates a dedicated code channel for an agent session. [Implementation](./src/agents/conversations/agents_conversations_create.py). +- **[agents.conversations.getCanvas](https://docs.slack.dev/reference/methods/agents.conversations.getCanvas)**: Fetches a canvas attached to a code channel — full content plus comment threads — in a single round-trip. [Implementation](./src/agents/conversations/agents_conversations_get_canvas.py). +- **[agents.conversations.listViews](https://docs.slack.dev/reference/methods/agents.conversations.listViews)**: Lists the view tabs attached to a code channel. [Implementation](./src/agents/conversations/agents_conversations_list_views.py). +- **[agents.conversations.removeView](https://docs.slack.dev/reference/methods/agents.conversations.removeView)**: Removes a view from a code channel. [Implementation](./src/agents/conversations/agents_conversations_remove_view.py). +- **[agents.conversations.setCanvasContent](https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent)**: Replaces the full markdown content of a canvas attached to a code channel, preserving the comment threads on the sections your agent didn't change. [Implementation](./src/agents/conversations/agents_conversations_set_canvas_content.py). +- **[agents.conversations.setCommands](https://docs.slack.dev/reference/methods/agents.conversations.setCommands)**: Registers the set of slash commands your agent offers in a code channel. [Implementation](./src/agents/conversations/agents_conversations_set_commands.py). +- **[agents.conversations.setProperties](https://docs.slack.dev/reference/methods/agents.conversations.setProperties)**: Sets properties on a code channel: context bar items and external resource details. [Implementation](./src/agents/conversations/agents_conversations_set_properties.py). +- **[agents.conversations.setView](https://docs.slack.dev/reference/methods/agents.conversations.setView)**: Creates or updates a view in a code channel. Views can render HTML, diffs, Block Kit, or canvases as tabs alongside the conversation. [Implementation](./src/agents/conversations/agents_conversations_set_view.py). - **[agents.sessions.rename](https://docs.slack.dev/reference/methods/agents.sessions.rename)**: Rename an agent session. [Implementation](./src/agents/sessions/agents_sessions_rename.py). - **[agents.sessions.setStatus](https://docs.slack.dev/reference/methods/agents.sessions.setStatus)**: Set an agent session's lifecycle status, creating the session if needed. [Implementation](./src/agents/sessions/agents_sessions_set_status.py). ### chat - **[chat.postMessage](https://docs.slack.dev/reference/methods/chat.postmessage)**: Sends a message to a channel. [Implementation](./src/chat/chat_post_message.py). - -### codeChannels - -- **[codeChannels.archive](https://docs.slack.dev/reference/methods/codeChannels.archive)**: Archives a code channel, optionally recording a summary message on the channel. [Implementation](./src/code_channels/code_channels_archive.py). -- **[codeChannels.create](https://docs.slack.dev/reference/methods/codeChannels.create)**: Creates a dedicated code channel for an agent session. [Implementation](./src/code_channels/code_channels_create.py). -- **[codeChannels.getCanvas](https://docs.slack.dev/reference/methods/codeChannels.getCanvas)**: Fetches a canvas attached to a code channel — full content plus comment threads — in a single round-trip. [Implementation](./src/code_channels/code_channels_get_canvas.py). -- **[codeChannels.listViews](https://docs.slack.dev/reference/methods/codeChannels.listViews)**: Lists the view tabs attached to a code channel. [Implementation](./src/code_channels/code_channels_list_views.py). -- **[codeChannels.removeView](https://docs.slack.dev/reference/methods/codeChannels.removeView)**: Removes a view from a code channel. [Implementation](./src/code_channels/code_channels_remove_view.py). -- **[codeChannels.rename](https://docs.slack.dev/reference/methods/codeChannels.rename)**: Renames a code channel. [Implementation](./src/code_channels/code_channels_rename.py). -- **[codeChannels.setCanvasContent](https://docs.slack.dev/reference/methods/codeChannels.setCanvasContent)**: Replaces the full markdown content of a canvas attached to a code channel, preserving the comment threads on the sections your agent didn't change. [Implementation](./src/code_channels/code_channels_set_canvas_content.py). -- **[codeChannels.setCommands](https://docs.slack.dev/reference/methods/codeChannels.setCommands)**: Registers the set of slash commands your agent offers in a code channel. [Implementation](./src/code_channels/code_channels_set_commands.py). -- **[codeChannels.setProperties](https://docs.slack.dev/reference/methods/codeChannels.setProperties)**: Sets properties on a code channel: context bar items and external resource details. [Implementation](./src/code_channels/code_channels_set_properties.py). -- **[codeChannels.setView](https://docs.slack.dev/reference/methods/codeChannels.setView)**: Creates or updates a view in a code channel. Views can render HTML, diffs, Block Kit, or canvases as tabs alongside the conversation. [Implementation](./src/code_channels/code_channels_set_view.py). diff --git a/methods/src/code_channels/.slack/.gitignore b/methods/src/agents/conversations/.slack/.gitignore similarity index 100% rename from methods/src/code_channels/.slack/.gitignore rename to methods/src/agents/conversations/.slack/.gitignore diff --git a/methods/src/code_channels/.slack/config.json b/methods/src/agents/conversations/.slack/config.json similarity index 100% rename from methods/src/code_channels/.slack/config.json rename to methods/src/agents/conversations/.slack/config.json diff --git a/methods/src/code_channels/.slack/hooks.json b/methods/src/agents/conversations/.slack/hooks.json similarity index 100% rename from methods/src/code_channels/.slack/hooks.json rename to methods/src/agents/conversations/.slack/hooks.json diff --git a/methods/src/code_channels/__init__.py b/methods/src/agents/conversations/__init__.py similarity index 100% rename from methods/src/code_channels/__init__.py rename to methods/src/agents/conversations/__init__.py diff --git a/methods/src/code_channels/code_channels_archive.py b/methods/src/agents/conversations/agents_conversations_archive.py similarity index 75% rename from methods/src/code_channels/code_channels_archive.py rename to methods/src/agents/conversations/agents_conversations_archive.py index 338ae1e..6603b82 100644 --- a/methods/src/code_channels/code_channels_archive.py +++ b/methods/src/agents/conversations/agents_conversations_archive.py @@ -8,8 +8,8 @@ # Initialize client = WebClient(token=token) -# Call the codeChannels.archive method -response = client.codeChannels_archive( +# Call the agents.conversations.archive method +response = client.agents_conversations_archive( channel_id="C123ABC456", summary_message_ts="1717171717.123456", ) diff --git a/methods/src/code_channels/code_channels_create.py b/methods/src/agents/conversations/agents_conversations_create.py similarity index 77% rename from methods/src/code_channels/code_channels_create.py rename to methods/src/agents/conversations/agents_conversations_create.py index 1f5c02a..f60fdfd 100644 --- a/methods/src/code_channels/code_channels_create.py +++ b/methods/src/agents/conversations/agents_conversations_create.py @@ -8,8 +8,8 @@ # Initialize client = WebClient(token=token) -# Call the codeChannels.create method -response = client.codeChannels_create( +# Call the agents.conversations.create method +response = client.agents_conversations_create( name="Fix flaky login test", origin_channel_id="C123ABC456", origin_message_ts="1717171717.123456", diff --git a/methods/src/code_channels/code_channels_get_canvas.py b/methods/src/agents/conversations/agents_conversations_get_canvas.py similarity index 66% rename from methods/src/code_channels/code_channels_get_canvas.py rename to methods/src/agents/conversations/agents_conversations_get_canvas.py index 016d0aa..1ccb9bd 100644 --- a/methods/src/code_channels/code_channels_get_canvas.py +++ b/methods/src/agents/conversations/agents_conversations_get_canvas.py @@ -8,9 +8,9 @@ # Initialize client = WebClient(token=token) -# Call the codeChannels.getCanvas method -response = client.codeChannels_getCanvas( - channel_id="C123ABC456", +# Call the agents.conversations.getCanvas method +response = client.agents_conversations_getCanvas( + channel="C123ABC456", canvas_id="F123ABC456", ) diff --git a/methods/src/code_channels/code_channels_list_views.py b/methods/src/agents/conversations/agents_conversations_list_views.py similarity index 71% rename from methods/src/code_channels/code_channels_list_views.py rename to methods/src/agents/conversations/agents_conversations_list_views.py index 928d18d..355d152 100644 --- a/methods/src/code_channels/code_channels_list_views.py +++ b/methods/src/agents/conversations/agents_conversations_list_views.py @@ -8,8 +8,8 @@ # Initialize client = WebClient(token=token) -# Call the codeChannels.listViews method -response = client.codeChannels_listViews( +# Call the agents.conversations.listViews method +response = client.agents_conversations_listViews( channel_id="C123ABC456", ) diff --git a/methods/src/code_channels/code_channels_remove_view.py b/methods/src/agents/conversations/agents_conversations_remove_view.py similarity index 72% rename from methods/src/code_channels/code_channels_remove_view.py rename to methods/src/agents/conversations/agents_conversations_remove_view.py index f8101a6..276ca0d 100644 --- a/methods/src/code_channels/code_channels_remove_view.py +++ b/methods/src/agents/conversations/agents_conversations_remove_view.py @@ -8,8 +8,8 @@ # Initialize client = WebClient(token=token) -# Call the codeChannels.removeView method -response = client.codeChannels_removeView( +# Call the agents.conversations.removeView method +response = client.agents_conversations_removeView( channel_id="C123ABC456", view_id="V123ABC456", ) diff --git a/methods/src/code_channels/code_channels_set_canvas_content.py b/methods/src/agents/conversations/agents_conversations_set_canvas_content.py similarity index 69% rename from methods/src/code_channels/code_channels_set_canvas_content.py rename to methods/src/agents/conversations/agents_conversations_set_canvas_content.py index ea3e365..5747dde 100644 --- a/methods/src/code_channels/code_channels_set_canvas_content.py +++ b/methods/src/agents/conversations/agents_conversations_set_canvas_content.py @@ -8,9 +8,9 @@ # Initialize client = WebClient(token=token) -# Call the codeChannels.setCanvasContent method -response = client.codeChannels_setCanvasContent( - channel_id="C123ABC456", +# Call the agents.conversations.setCanvasContent method +response = client.agents_conversations_setCanvasContent( + channel="C123ABC456", canvas_id="F123ABC456", content="# Plan\n\n1. Reproduce the flaky test\n2. Fix the race\n3. Verify", ) diff --git a/methods/src/code_channels/code_channels_set_commands.py b/methods/src/agents/conversations/agents_conversations_set_commands.py similarity index 81% rename from methods/src/code_channels/code_channels_set_commands.py rename to methods/src/agents/conversations/agents_conversations_set_commands.py index 0abe872..4d96512 100644 --- a/methods/src/code_channels/code_channels_set_commands.py +++ b/methods/src/agents/conversations/agents_conversations_set_commands.py @@ -8,8 +8,8 @@ # Initialize client = WebClient(token=token) -# Call the codeChannels.setCommands method -response = client.codeChannels_setCommands( +# Call the agents.conversations.setCommands method +response = client.agents_conversations_setCommands( channel_id="C123ABC456", commands=[ { diff --git a/methods/src/code_channels/code_channels_set_properties.py b/methods/src/agents/conversations/agents_conversations_set_properties.py similarity index 82% rename from methods/src/code_channels/code_channels_set_properties.py rename to methods/src/agents/conversations/agents_conversations_set_properties.py index 71219f8..e93b5d0 100644 --- a/methods/src/code_channels/code_channels_set_properties.py +++ b/methods/src/agents/conversations/agents_conversations_set_properties.py @@ -8,8 +8,8 @@ # Initialize client = WebClient(token=token) -# Call the codeChannels.setProperties method -response = client.codeChannels_setProperties( +# Call the agents.conversations.setProperties method +response = client.agents_conversations_setProperties( channel_id="C123ABC456", code_channel={ "context_bar_items": [ diff --git a/methods/src/code_channels/code_channels_set_view.py b/methods/src/agents/conversations/agents_conversations_set_view.py similarity index 81% rename from methods/src/code_channels/code_channels_set_view.py rename to methods/src/agents/conversations/agents_conversations_set_view.py index 98fffa7..46e952c 100644 --- a/methods/src/code_channels/code_channels_set_view.py +++ b/methods/src/agents/conversations/agents_conversations_set_view.py @@ -8,8 +8,8 @@ # Initialize client = WebClient(token=token) -# Call the codeChannels.setView method -response = client.codeChannels_setView( +# Call the agents.conversations.setView method +response = client.agents_conversations_setView( channel_id="C123ABC456", type="diff", content="diff --git a/cron.py b/cron.py\n--- a/cron.py\n+++ b/cron.py\n@@ ...", diff --git a/methods/src/code_channels/manifest.json b/methods/src/agents/conversations/manifest.json similarity index 83% rename from methods/src/code_channels/manifest.json rename to methods/src/agents/conversations/manifest.json index 3c0f74d..76c53c1 100644 --- a/methods/src/code_channels/manifest.json +++ b/methods/src/agents/conversations/manifest.json @@ -1,7 +1,7 @@ { "display_information": { "name": "Slack API Methods", - "description": "Example implementations to call \"codeChannels\" methods" + "description": "Example implementations to call \"agents.conversations\" methods" }, "features": { "bot_user": { diff --git a/methods/src/code_channels/code_channels_rename.py b/methods/src/code_channels/code_channels_rename.py deleted file mode 100644 index 097d446..0000000 --- a/methods/src/code_channels/code_channels_rename.py +++ /dev/null @@ -1,18 +0,0 @@ -import os - -from slack_sdk import WebClient - -# Read a token from an environment variable -token = os.environ.get("SLACK_TOKEN") - -# Initialize -client = WebClient(token=token) - -# Call the codeChannels.rename method -response = client.codeChannels_rename( - channel_id="C123ABC456", - name="Fix flaky login test v2", -) - -# Inspect the response -print(response) From b1208f8a0e99c610bd74bf1d1d292aee775fc966 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Thu, 24 Sep 2026 10:12:13 -0700 Subject: [PATCH 08/11] docs(methods): align agents.conversations README descriptions with docs Match each agents.conversations.* README row to the canonical one-line description on docs.slack.dev (docs #816), replacing the embellished summaries with the reference text verbatim. Co-Authored-By: Claude Co-Authored-By: Claude Opus 4.8 (1M context) --- methods/README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/methods/README.md b/methods/README.md index 29eaf3b..5044596 100644 --- a/methods/README.md +++ b/methods/README.md @@ -18,15 +18,15 @@ $ slack run chat_post_message.py # Make the request ### agents -- **[agents.conversations.archive](https://docs.slack.dev/reference/methods/agents.conversations.archive)**: Archives a code channel, optionally recording a summary message on the channel. [Implementation](./src/agents/conversations/agents_conversations_archive.py). -- **[agents.conversations.create](https://docs.slack.dev/reference/methods/agents.conversations.create)**: Creates a dedicated code channel for an agent session. [Implementation](./src/agents/conversations/agents_conversations_create.py). -- **[agents.conversations.getCanvas](https://docs.slack.dev/reference/methods/agents.conversations.getCanvas)**: Fetches a canvas attached to a code channel — full content plus comment threads — in a single round-trip. [Implementation](./src/agents/conversations/agents_conversations_get_canvas.py). -- **[agents.conversations.listViews](https://docs.slack.dev/reference/methods/agents.conversations.listViews)**: Lists the view tabs attached to a code channel. [Implementation](./src/agents/conversations/agents_conversations_list_views.py). -- **[agents.conversations.removeView](https://docs.slack.dev/reference/methods/agents.conversations.removeView)**: Removes a view from a code channel. [Implementation](./src/agents/conversations/agents_conversations_remove_view.py). -- **[agents.conversations.setCanvasContent](https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent)**: Replaces the full markdown content of a canvas attached to a code channel, preserving the comment threads on the sections your agent didn't change. [Implementation](./src/agents/conversations/agents_conversations_set_canvas_content.py). -- **[agents.conversations.setCommands](https://docs.slack.dev/reference/methods/agents.conversations.setCommands)**: Registers the set of slash commands your agent offers in a code channel. [Implementation](./src/agents/conversations/agents_conversations_set_commands.py). -- **[agents.conversations.setProperties](https://docs.slack.dev/reference/methods/agents.conversations.setProperties)**: Sets properties on a code channel: context bar items and external resource details. [Implementation](./src/agents/conversations/agents_conversations_set_properties.py). -- **[agents.conversations.setView](https://docs.slack.dev/reference/methods/agents.conversations.setView)**: Creates or updates a view in a code channel. Views can render HTML, diffs, Block Kit, or canvases as tabs alongside the conversation. [Implementation](./src/agents/conversations/agents_conversations_set_view.py). +- **[agents.conversations.archive](https://docs.slack.dev/reference/methods/agents.conversations.archive)**: Archive a code channel. [Implementation](./src/agents/conversations/agents_conversations_archive.py). +- **[agents.conversations.create](https://docs.slack.dev/reference/methods/agents.conversations.create)**: Create a dedicated code channel for an agent session. [Implementation](./src/agents/conversations/agents_conversations_create.py). +- **[agents.conversations.getCanvas](https://docs.slack.dev/reference/methods/agents.conversations.getCanvas)**: Fetch a canvas attached to a code channel. [Implementation](./src/agents/conversations/agents_conversations_get_canvas.py). +- **[agents.conversations.listViews](https://docs.slack.dev/reference/methods/agents.conversations.listViews)**: List the views currently attached to a code channel. [Implementation](./src/agents/conversations/agents_conversations_list_views.py). +- **[agents.conversations.removeView](https://docs.slack.dev/reference/methods/agents.conversations.removeView)**: Remove a view from a code channel. [Implementation](./src/agents/conversations/agents_conversations_remove_view.py). +- **[agents.conversations.setCanvasContent](https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent)**: Replace the full markdown content of a plan canvas attached to a code channel. [Implementation](./src/agents/conversations/agents_conversations_set_canvas_content.py). +- **[agents.conversations.setCommands](https://docs.slack.dev/reference/methods/agents.conversations.setCommands)**: Register the set of agent-defined slash commands for the calling agent in a code channel. [Implementation](./src/agents/conversations/agents_conversations_set_commands.py). +- **[agents.conversations.setProperties](https://docs.slack.dev/reference/methods/agents.conversations.setProperties)**: Set properties on a code channel. [Implementation](./src/agents/conversations/agents_conversations_set_properties.py). +- **[agents.conversations.setView](https://docs.slack.dev/reference/methods/agents.conversations.setView)**: Create or update a view in a code channel. [Implementation](./src/agents/conversations/agents_conversations_set_view.py). - **[agents.sessions.rename](https://docs.slack.dev/reference/methods/agents.sessions.rename)**: Rename an agent session. [Implementation](./src/agents/sessions/agents_sessions_rename.py). - **[agents.sessions.setStatus](https://docs.slack.dev/reference/methods/agents.sessions.setStatus)**: Set an agent session's lifecycle status, creating the session if needed. [Implementation](./src/agents/sessions/agents_sessions_set_status.py). From c721b51091ea34b1f80abea949bcb68b30ca9ff8 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Thu, 24 Sep 2026 14:59:54 -0700 Subject: [PATCH 09/11] docs(methods): match agents.conversations examples to docs #816 verbatim Align each example's payload with the request example on its docs.slack.dev reference page (docs #816): - create: session_id + 'Migrate billing cron to Temporal' name - archive: summary_message_ts - setProperties: full 4-item context_bar_items (repo/branch/pr/ci) - setView: html view with view_key/name/csp - setCommands: create-pr (argument_hint) + run-tests - removeView: identify by view_key - getCanvas: include_resolved - setCanvasContent: migration-plan content Duplicates the canonical examples rather than inventing variants. Co-Authored-By: Claude Co-Authored-By: Claude Opus 4.8 (1M context) --- .../agents_conversations_archive.py | 4 ++-- .../agents_conversations_create.py | 5 ++-- .../agents_conversations_get_canvas.py | 5 ++-- .../agents_conversations_list_views.py | 2 +- .../agents_conversations_remove_view.py | 4 ++-- ...agents_conversations_set_canvas_content.py | 6 ++--- .../agents_conversations_set_commands.py | 11 +++++---- .../agents_conversations_set_properties.py | 23 ++++++++++++++++--- .../agents_conversations_set_view.py | 12 ++++++---- 9 files changed, 47 insertions(+), 25 deletions(-) diff --git a/methods/src/agents/conversations/agents_conversations_archive.py b/methods/src/agents/conversations/agents_conversations_archive.py index 6603b82..e7178f7 100644 --- a/methods/src/agents/conversations/agents_conversations_archive.py +++ b/methods/src/agents/conversations/agents_conversations_archive.py @@ -10,8 +10,8 @@ # Call the agents.conversations.archive method response = client.agents_conversations_archive( - channel_id="C123ABC456", - summary_message_ts="1717171717.123456", + channel_id="C9876543210", + summary_message_ts="1717182000.456789", ) # Inspect the response diff --git a/methods/src/agents/conversations/agents_conversations_create.py b/methods/src/agents/conversations/agents_conversations_create.py index f60fdfd..791f780 100644 --- a/methods/src/agents/conversations/agents_conversations_create.py +++ b/methods/src/agents/conversations/agents_conversations_create.py @@ -10,8 +10,9 @@ # Call the agents.conversations.create method response = client.agents_conversations_create( - name="Fix flaky login test", - origin_channel_id="C123ABC456", + name="Migrate billing cron to Temporal", + session_id="ses_8675309", + origin_channel_id="C0123456789", origin_message_ts="1717171717.123456", ) diff --git a/methods/src/agents/conversations/agents_conversations_get_canvas.py b/methods/src/agents/conversations/agents_conversations_get_canvas.py index 1ccb9bd..d20456e 100644 --- a/methods/src/agents/conversations/agents_conversations_get_canvas.py +++ b/methods/src/agents/conversations/agents_conversations_get_canvas.py @@ -10,8 +10,9 @@ # Call the agents.conversations.getCanvas method response = client.agents_conversations_getCanvas( - channel="C123ABC456", - canvas_id="F123ABC456", + channel="C9876543210", + canvas_id="F1234567890", + include_resolved=False, ) # Inspect the response diff --git a/methods/src/agents/conversations/agents_conversations_list_views.py b/methods/src/agents/conversations/agents_conversations_list_views.py index 355d152..4d6c06d 100644 --- a/methods/src/agents/conversations/agents_conversations_list_views.py +++ b/methods/src/agents/conversations/agents_conversations_list_views.py @@ -10,7 +10,7 @@ # Call the agents.conversations.listViews method response = client.agents_conversations_listViews( - channel_id="C123ABC456", + channel_id="C9876543210", ) # Inspect the response diff --git a/methods/src/agents/conversations/agents_conversations_remove_view.py b/methods/src/agents/conversations/agents_conversations_remove_view.py index 276ca0d..187bb56 100644 --- a/methods/src/agents/conversations/agents_conversations_remove_view.py +++ b/methods/src/agents/conversations/agents_conversations_remove_view.py @@ -10,8 +10,8 @@ # Call the agents.conversations.removeView method response = client.agents_conversations_removeView( - channel_id="C123ABC456", - view_id="V123ABC456", + channel_id="C9876543210", + view_key="reports/coverage.html", ) # Inspect the response diff --git a/methods/src/agents/conversations/agents_conversations_set_canvas_content.py b/methods/src/agents/conversations/agents_conversations_set_canvas_content.py index 5747dde..8721507 100644 --- a/methods/src/agents/conversations/agents_conversations_set_canvas_content.py +++ b/methods/src/agents/conversations/agents_conversations_set_canvas_content.py @@ -10,9 +10,9 @@ # Call the agents.conversations.setCanvasContent method response = client.agents_conversations_setCanvasContent( - channel="C123ABC456", - canvas_id="F123ABC456", - content="# Plan\n\n1. Reproduce the flaky test\n2. Fix the race\n3. Verify", + channel="C9876543210", + canvas_id="F1234567890", + content="# Migration plan\n\n1. Inventory cron jobs\n2. Port billing jobs last\n", ) # Inspect the response diff --git a/methods/src/agents/conversations/agents_conversations_set_commands.py b/methods/src/agents/conversations/agents_conversations_set_commands.py index 4d96512..4424083 100644 --- a/methods/src/agents/conversations/agents_conversations_set_commands.py +++ b/methods/src/agents/conversations/agents_conversations_set_commands.py @@ -10,15 +10,16 @@ # Call the agents.conversations.setCommands method response = client.agents_conversations_setCommands( - channel_id="C123ABC456", + channel_id="C9876543210", commands=[ { - "name": "test", - "description": "Run the test suite", + "name": "create-pr", + "description": "Open a pull request for the current branch", + "argument_hint": "[title]", }, { - "name": "diff", - "description": "Show the current diff", + "name": "run-tests", + "description": "Run the test suite and report back", }, ], ) diff --git a/methods/src/agents/conversations/agents_conversations_set_properties.py b/methods/src/agents/conversations/agents_conversations_set_properties.py index e93b5d0..3366362 100644 --- a/methods/src/agents/conversations/agents_conversations_set_properties.py +++ b/methods/src/agents/conversations/agents_conversations_set_properties.py @@ -10,14 +10,31 @@ # Call the agents.conversations.setProperties method response = client.agents_conversations_setProperties( - channel_id="C123ABC456", + channel_id="C9876543210", code_channel={ "context_bar_items": [ { "key": "repo", - "label": "acme/billing", + "label": "borant/billing", "icon": "folder", - "url": "https://github.com/acme/billing", + "url": "https://github.com/borant/billing", + }, + { + "key": "branch", + "label": "agent/migrate-cron", + "icon": "branch", + "url": "https://github.com/borant/billing/tree/agent/migrate-cron", + }, + { + "key": "pr", + "label": "PR #42 is open", + "icon": "hierarchy", + "url": "https://github.com/borant/billing/pull/42", + }, + { + "key": "ci", + "label": "Tests pending", + "icon": "terminal", }, ] }, diff --git a/methods/src/agents/conversations/agents_conversations_set_view.py b/methods/src/agents/conversations/agents_conversations_set_view.py index 46e952c..858e71b 100644 --- a/methods/src/agents/conversations/agents_conversations_set_view.py +++ b/methods/src/agents/conversations/agents_conversations_set_view.py @@ -10,11 +10,13 @@ # Call the agents.conversations.setView method response = client.agents_conversations_setView( - channel_id="C123ABC456", - type="diff", - content="diff --git a/cron.py b/cron.py\n--- a/cron.py\n+++ b/cron.py\n@@ ...", - base_branch="main", - head_branch="agent/migrate-cron", + channel_id="C9876543210", + view_key="reports/coverage.html", + name="Coverage", + content="……", + csp={ + "resource_domains": ["https://cdn.jsdelivr.net"], + }, ) # Inspect the response From f900ed5160da05354b0ca1e5d62543302c83acee Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Thu, 24 Sep 2026 15:36:02 -0700 Subject: [PATCH 10/11] feat(methods): enable Socket Mode in agents.conversations manifest Set socket_mode_enabled: true so the example app can register agent slash commands. agents.conversations.setCommands returns no_actions_url unless the app has either a code_channels.slash_command_url or Socket Mode; Socket Mode routes command invocations automatically with no public URL to stand up. Co-Authored-By: Claude Co-Authored-By: Claude Opus 4.8 (1M context) --- methods/src/agents/conversations/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/methods/src/agents/conversations/manifest.json b/methods/src/agents/conversations/manifest.json index 76c53c1..8e6a0c1 100644 --- a/methods/src/agents/conversations/manifest.json +++ b/methods/src/agents/conversations/manifest.json @@ -19,7 +19,7 @@ }, "settings": { "org_deploy_enabled": true, - "socket_mode_enabled": false, + "socket_mode_enabled": true, "token_rotation_enabled": false } } From b7ed427d32d11cdd5b3dbc20eaf9c77b945c6e55 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Fri, 25 Sep 2026 13:33:13 -0700 Subject: [PATCH 11/11] docs(methods): add the summarize command to setCommands example Match the three-command payload (create-pr / run-tests / summarize) on the agents.conversations.setCommands docs page. Co-Authored-By: Claude Co-Authored-By: Claude Opus 4.8 (1M context) --- .../agents/conversations/agents_conversations_set_commands.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/methods/src/agents/conversations/agents_conversations_set_commands.py b/methods/src/agents/conversations/agents_conversations_set_commands.py index 4424083..7fed97f 100644 --- a/methods/src/agents/conversations/agents_conversations_set_commands.py +++ b/methods/src/agents/conversations/agents_conversations_set_commands.py @@ -21,6 +21,10 @@ "name": "run-tests", "description": "Run the test suite and report back", }, + { + "name": "summarize", + "description": "Post a summary of the work so far", + }, ], )