Conversation
|
Examples PR (depends on this): slack-samples/bolt-python-examples#194 |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. |
bfa80f8 to
c84fb38
Compare
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>
b647044 to
5ac7951
Compare
ea7f8e0 to
1e8707b
Compare
…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>
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
left a comment
There was a problem hiding this comment.
🔭 Notes on required arguments according to adjacent docs I believe.
| *, | ||
| team_id: Optional[str] = None, | ||
| session_id: Optional[str] = None, | ||
| name: Optional[str] = None, |
There was a problem hiding this comment.
| agent_content_hash: Optional[str] = None, | ||
| pr_url: Optional[str] = None, |
There was a problem hiding this comment.
👁️🗨️ question: Are these actual arguments?
There was a problem hiding this comment.
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
…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>
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
left a comment
There was a problem hiding this comment.
🧪 Test changes of mock data to request please!
| elif method_name == "agents_conversations_setProperties": | ||
| self.api_methods_to_call.remove(method(channel_id="C123")["method"]) | ||
| await async_method(channel_id="C123") |
There was a problem hiding this comment.
📝 note: Either code_channel or agent_resource should be included here.
| 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") |
There was a problem hiding this comment.
📔 note: Use an ID with prefix such as: "Ct1234567890"
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>
Adds the
agents.conversations.*Slack Code Web API method family to the sync, async, and legacy web clients:agents.conversations.createagents.conversations.archiveagents.conversations.setPropertiesagents.conversations.setCommandsagents.conversations.setViewagents.conversations.listViewsagents.conversations.removeViewagents.conversations.getCanvasagents.conversations.setCanvasContentAll 9 require the
code_channels:managebot scope (vs.chat:writefor theagents.sessions.*methods already on this branch). Each method uses**kwargspassthrough with a rich docstring enumerating its args (name / type / required), drawn from the docs schemas in slackapi/slack-api-docs#816. NotegetCanvasandsetCanvasContenttakechannel(notchannel_id).This deliberately does not include the legacy
codeChannels.*method names — we ship theagents.conversations.*names only (no aliases). The redundantcodeChannels.renameis dropped entirely;agents.sessions.renamealready covers it.async_client.pyandlegacy_client.pyare generated fromclient.pyviascripts/codegen.py. The coverage test is updated to the new names.Still experimental / draft, pending the API and the docs (#816) finalizing.