Skip to content

feat(web-api): add agents.conversations.* methods - #1943

Draft
zimeg wants to merge 13 commits into
mainfrom
clack/code-channels-methods
Draft

zimeg wants to merge 13 commits into
mainfrom
clack/code-channels-methods

Conversation

@zimeg

@zimeg zimeg commented Aug 18, 2026 •

Copy link
Copy Markdown
Member

Adds the agents.conversations.* Slack Code Web API method family to the sync, async, and legacy web clients:

  • agents.conversations.create
  • agents.conversations.archive
  • agents.conversations.setProperties
  • agents.conversations.setCommands
  • agents.conversations.setView
  • agents.conversations.listViews
  • agents.conversations.removeView
  • agents.conversations.getCanvas
  • agents.conversations.setCanvasContent

All 9 require the code_channels:manage bot scope (vs. chat:write for the agents.sessions.* methods already on this branch). Each method uses **kwargs passthrough with a rich docstring enumerating its args (name / type / required), drawn from the docs schemas in slackapi/slack-api-docs#816. Note getCanvas and setCanvasContent take channel (not channel_id).

This deliberately does not include the legacy codeChannels.* method names — we ship the agents.conversations.* names only (no aliases). The redundant codeChannels.rename is dropped entirely; agents.sessions.rename already covers it.

async_client.py and legacy_client.py are generated from client.py via scripts/codegen.py. The coverage test is updated to the new names.

Still experimental / draft, pending the API and the docs (#816) finalizing.

@zimeg

zimeg commented Aug 18, 2026

Copy link
Copy Markdown
Member Author

Examples PR (depends on this): slack-samples/bolt-python-examples#194

@codecov

codecov Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.27%. Comparing base (77d0a1a) to head (28fbc3f).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1943      +/-   ##
==========================================
+ Coverage   84.14%   84.27%   +0.13%     
==========================================
  Files         118      118              
  Lines       13566    13674     +108     
==========================================
+ Hits        11415    11524     +109     
+ Misses       2151     2150       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

zimeg and others added 2 commits August 19, 2026 15:13
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Add the codeChannels.* Web API methods (archive, create, getCanvas,
listViews, removeView, rename, setCanvasContent, setCommands,
setProperties, setView) with arguments aligned to the API reference,
alphabetized, and registered in the method coverage test. Stacked on the
agents.sessions.* methods.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg
zimeg force-pushed the clack/code-channels-methods branch from b647044 to 5ac7951 Compare August 19, 2026 22:16
@zimeg
zimeg changed the base branch from main to clack/agents-sessions-methods August 19, 2026 22:17
@zimeg
zimeg force-pushed the clack/agents-sessions-methods branch 3 times, most recently from ea7f8e0 to 1e8707b Compare August 21, 2026 21:48
Base automatically changed from clack/agents-sessions-methods to main August 21, 2026 23:10
…o legacy names)

Renames the 9 Slack Code Web API methods from the legacy codeChannels.*
names to the agents.conversations.* family, per the 2026-09-23 decision to
ship only the new names (no legacy aliases). Drops codeChannels.rename
entirely — agents.sessions.rename already covers it.

Methods now use **kwargs passthrough with rich docstrings enumerating each
arg (name / type / required) drawn from the docs #816 schemas, plus the
canonical doc URL. getCanvas and setCanvasContent take `channel` (not
`channel_id`) per the API. All 9 require the code_channels:manage scope
(vs chat:write for agents.sessions.*).

async_client.py and legacy_client.py are regenerated from client.py via
scripts/codegen.py. Coverage test updated to the new names.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@zimeg zimeg changed the title feat(web-api): add codeChannels.* methods feat(web-api): add agents.conversations.* (Slack Code) methods Sep 23, 2026
zimeg and others added 3 commits September 23, 2026 14:42
Rewrite the 9 agents.conversations.* methods (create, archive,
setProperties, setView, setCommands, listViews, removeView, getCanvas,
setCanvasContent) from **kwargs-only to explicit keyword-only typed
params, matching the repo house convention (conversations_create /
chat_postMessage): required args have no default, optional args are
Optional[...] = None, kwargs.update({...}) maps each named param, and
**kwargs stays as the fallback for future/undocumented args.

Arg names preserved verbatim from the method schemas: getCanvas and
setCanvasContent take `channel` (not `channel_id`); the other seven take
`channel_id`. Transport unchanged (json=kwargs, json_input_supported).
setView.blocks uses Optional[Sequence[Union[Dict, Block]]] mirroring
chat_postMessage; complex object args (code_channel, agent_resource,
commands, csp) stay Optional[Dict]/Optional[Sequence[Dict]] pending
published nested shapes. agents.sessions.* were already typed — left
as-is. Regenerated async_client.py + legacy_client.py via codegen.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Move the agents.* block (conversations then sessions) out of the
assistant_threads_* family and into its natural a* slot before api_test,
so assistant_threads_* is contiguous again. Also drop the
code_channels:manage scope note from the 9 agents.conversations.* docstrings
and the "takes channel, not channel_id" aside from getCanvas/setCanvasContent
so the docstrings match the docs (scopes/args are documented there).

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@zimeg zimeg left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🔭 Notes on required arguments according to adjacent docs I believe.

Comment thread slack_sdk/web/client.py Outdated
Comment thread slack_sdk/web/client.py Outdated
*,
team_id: Optional[str] = None,
session_id: Optional[str] = None,
name: Optional[str] = None,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

⚠️ issue: Should be required

Comment thread slack_sdk/web/client.py Outdated
Comment thread slack_sdk/web/client.py Outdated
Comment thread slack_sdk/web/client.py Outdated
Comment thread slack_sdk/web/client.py Outdated
Comment thread slack_sdk/web/client.py Outdated
Comment thread slack_sdk/web/client.py Outdated
Comment thread slack_sdk/web/client.py
Comment on lines +2106 to +2107
agent_content_hash: Optional[str] = None,
pr_url: Optional[str] = None,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

👁️‍🗨️ question: Are these actual arguments?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes — pr_url, base_branch, head_branch, and agent_content_hash are all documented agents.conversations.setView arguments (diff-view metadata: the PR link, the branches the diff is between, and a content hash). They only apply to the diff view type, which is why they read as odd next to the generic ones. Kept them as optional params. Ref: https://docs.slack.dev/reference/methods/agents.conversations.setView

zimeg and others added 3 commits September 23, 2026 15:25
…ethods

# Conflicts:
#	slack_sdk/web/async_client.py
#	slack_sdk/web/client.py
#	slack_sdk/web/legacy_client.py
#	tests/slack_sdk_async/web/test_web_client_coverage.py
Address inline review feedback on the agents.conversations.* methods:
make the identifying argument a required typed param instead of an
optional one, moving it to the front of the keyword-only args.

- agents.conversations.archive: channel_id now required
- agents.conversations.create: name now required (the API allows omitting
  it when origin_channel_id + origin_message_ts are given, but require it
  for a clearer default DX)
- agents.conversations.listViews: channel_id now required
- agents.conversations.removeView: channel_id now required
- agents.conversations.setCommands: channel_id now required
- agents.conversations.setProperties: channel_id now required
- agents.conversations.setView: channel_id now required

Also drop the "Provide exactly one of view_key or view_id" line from
removeView's docstring, and add the summary/description blank line the
merged-in docstring style now expects (ruff D205/D415).

Regenerated async_client.py and legacy_client.py via scripts/codegen.py.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The main merge left a stale duplicate agents_sessions_* elif pair (dead code,
unreachable after the first match). Remove it, and order the agents.* coverage
branches conversations-then-sessions to match the client method ordering.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@zimeg zimeg changed the title feat(web-api): add agents.conversations.* (Slack Code) methods feat(web-api): add agents.conversations.* methods Sep 24, 2026
zimeg and others added 2 commits September 24, 2026 10:05
Move the agents.conversations.*/agents.sessions.* coverage elif cases
up beside the admin.*/apps.* cluster so they sit where agents.* appears
in all_api_methods, instead of trailing after users.discoverableContacts.
Pure reorder; no argument changes.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@zimeg zimeg left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🧪 Test changes of mock data to request please!

Comment on lines +119 to +121
elif method_name == "agents_conversations_setProperties":
self.api_methods_to_call.remove(method(channel_id="C123")["method"])
await async_method(channel_id="C123")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

📝 note: Either code_channel or agent_resource should be included here.

Comment thread tests/slack_sdk_async/web/test_web_client_coverage.py Outdated
Comment on lines +110 to +112
elif method_name == "agents_conversations_removeView":
self.api_methods_to_call.remove(method(channel_id="C123", view_id="V123")["method"])
await async_method(channel_id="C123", view_id="V123")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

📔 note: Use an ID with prefix such as: "Ct1234567890"

zimeg and others added 2 commits September 24, 2026 10:31
Address review on the coverage cases:
- setProperties: send a real code_channel.context_bar_items payload
  ({key,label,icon}) instead of only channel_id
- setView: send a full diff-view payload (content/base_branch/head_branch)
  instead of just type=diff
- getCanvas/setCanvasContent: use a canvas-prefixed id (Ct...) not F...

Payloads mirror the docs #816 examples.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The prefixed-id note was about the view identifier, not the canvas
methods. Use view_id="Ct123" for removeView; revert getCanvas /
setCanvasContent canvas_id back to F123.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality semver:minor web-client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant