Skip to content

feat(blocks): add Slack SendSlackMessageBlock - #13008

Merged
ntindle merged 5 commits into
Significant-Gravitas:devfrom
omsharma0401:feat/add-slack-blocks
May 7, 2026
Merged

feat(blocks): add Slack SendSlackMessageBlock#13008
ntindle merged 5 commits into
Significant-Gravitas:devfrom
omsharma0401:feat/add-slack-blocks

Conversation

@omsharma0401

@omsharma0401 omsharma0401 commented May 5, 2026

Copy link
Copy Markdown
Contributor

Slack was missing from AutoGPT's block library despite being one of the most widely used tools for team notifications and workflow automation. Without it, sending Slack messages required a raw HTTP block with a manually constructed payload and no credential integration or UI discoverability.

This PR adds a SendSlackMessageBlock that posts messages to any Slack channel, DM, or thread via the Slack Web API. It follows the same structure as the existing Telegram and Discord integrations.

Slack uses a static Bot Token rather than an OAuth flow, so the block uses APIKeyCredentials with no redirect handling. The HTTP call is wrapped in a private _post_message method so the block test harness can mock the network call without patching an import path. The block outputs ts, Slack's unique message timestamp, which can be passed into thread_ts on a subsequent block to chain replies in a thread.

Added 🏗️

backend/integrations/providers.py — Added SLACK = "slack" to the ProviderName enum, which is required for is_block_auth_configured() to recognize Slack and enable the block in the UI.

backend/blocks/slack/_auth.py — Defines SlackCredentials as APIKeyCredentials. Exports SlackCredentialsField with bot token setup instructions, and TEST_CREDENTIALS with TEST_CREDENTIALS_INPUT for the block test harness.

backend/blocks/slack/_api.py — HTTP layer for the Slack Web API. call_slack_api posts to https://slack.com/api/{method} with a Bearer token and raises SlackAPIException on ok: false. post_message builds the chat.postMessage payload and returns a typed SlackMessageResult.

backend/blocks/slack/_config.py — Registers Slack via ProviderBuilder so it appears in the integrations settings UI with the correct description and supported auth type.

backend/blocks/slack/blocks.pySendSlackMessageBlock in category SOCIAL. Required inputs are the bot token, a channel ID or name, and the message text. Optional inputs include thread_ts for thread replies, username and icon_emoji which require the chat:write.customize scope, and unfurl_links and mrkdwn. Outputs are ts and channel.

docs/integrations/block-integrations/slack/blocks.md — Inputs and outputs tables generated from block introspection; the description, how-it-works, and use-case sections written by hand.

frontend/public/integrations/slack.png — 512x512 logo asset for the integrations UI.

Checklist 📋

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • Block UUID is valid UUID4
    • Block is discovered by load_all_blocks()
    • SendSlackMessageBlock runs correctly with _post_message mocked
    • SLACK is recognized by is_block_auth_configured()
    • Docs regenerated with no stale-check failures
    • ruff and black pass on all files in backend/blocks/slack/

@omsharma0401
omsharma0401 requested review from a team as code owners May 5, 2026 14:45
@omsharma0401
omsharma0401 requested review from kcze and removed request for a team May 5, 2026 14:45
@omsharma0401
omsharma0401 requested a review from majdyz May 5, 2026 14:45
@github-project-automation github-project-automation Bot moved this to 🆕 Needs initial review in AutoGPT development kanban May 5, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation platform/frontend AutoGPT Platform - Front end platform/backend AutoGPT Platform - Back end platform/blocks labels May 5, 2026
@coderabbitai

coderabbitai Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Adds Slack message integration: API helpers (call_slack_api, post_message), a SendSlackMessageBlock, Slack credential types/fixtures, provider enum registration, tests for API and block behavior, and documentation updates.

Changes

Slack Message Integration

Layer / File(s) Summary
Provider Registration
autogpt_platform/backend/backend/integrations/providers.py
Adds SLACK enum member to ProviderName to register Slack as a supported credential provider.
API Types & Contract
autogpt_platform/backend/backend/blocks/slack/_api.py
Defines SLACK_API_BASE constant, SlackMessageResult Pydantic model (permissive extras), and SlackAPIException.
Slack API Helpers
autogpt_platform/backend/backend/blocks/slack/_api.py
Implements call_slack_api to POST authenticated requests and post_message to assemble/send chat.postMessage payloads with optional thread/username/icon/mrkdwn/unfurl options.
Authentication Types
autogpt_platform/backend/backend/blocks/slack/_auth.py
Defines SlackCredentials alias, SlackCredentialsInput type, SlackCredentialsField() helper, and test credential fixtures.
Block Implementation
autogpt_platform/backend/backend/blocks/slack/blocks.py
Implements SendSlackMessageBlock with Input/Output schema, run() that forwards to _post_message, and _post_message wrapper calling post_message.
Test Suite
autogpt_platform/backend/backend/blocks/slack/slack_test.py
Adds pytest suite covering exception/model behavior, call_slack_api and post_message behavior, parameter handling, error propagation, and block execution tests.
Documentation
docs/integrations/block-integrations/slack/blocks.md, docs/integrations/SUMMARY.md, docs/integrations/README.md
Adds Slack Blocks documentation and updates integration TOC and README index.

Sequence Diagram(s)

sequenceDiagram
  participant Executor
  participant SendSlackMessageBlock
  participant _post_message
  participant post_message
  participant SlackAPI
  Executor->>SendSlackMessageBlock: run(input_data, credentials)
  SendSlackMessageBlock->>_post_message: forward parameters
  _post_message->>post_message: call with channel, text, options
  post_message->>SlackAPI: POST /api/chat.postMessage (Bearer token)
  SlackAPI-->>post_message: JSON response (ok / error)
  alt ok=false
    post_message-->>_post_message: raise SlackAPIException
  else ok=true
    post_message-->>_post_message: SlackMessageResult
  end
  _post_message-->>SendSlackMessageBlock: SlackMessageResult or propagate exception
  SendSlackMessageBlock-->>Executor: yield ts, channel
Loading

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels: Review effort 4/5

Suggested reviewers:

  • kcze
  • majdyz

"🐰 I hopped a quick note over the line,
Tokens tucked, the bot replied just fine.
Channels, threads, and little emoji grins,
Now AutoGPT knows how to send wins.
Hooray — I bounced and thumped my twin feet!"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.65% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(blocks): add Slack SendSlackMessageBlock' clearly and concisely describes the main change—adding a new Slack message block to the block library.
Description check ✅ Passed The description comprehensively explains the motivation for the Slack integration, details all new files and modules, and documents the testing checklist—all directly related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the size/l label May 5, 2026
@CLAassistant

CLAassistant commented May 5, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@codecov

codecov Bot commented May 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.70130% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.09%. Comparing base (8d65344) to head (5ab9713).
⚠️ Report is 2 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #13008      +/-   ##
==========================================
+ Coverage   70.07%   70.09%   +0.01%     
==========================================
  Files        2170     2174       +4     
  Lines      161871   162147     +276     
  Branches    16647    16659      +12     
==========================================
+ Hits       113433   113650     +217     
- Misses      45115    45177      +62     
+ Partials     3323     3320       -3     
Flag Coverage Δ
platform-backend 79.20% <98.70%> (-0.02%) ⬇️
platform-frontend 30.98% <ø> (+<0.01%) ⬆️
platform-frontend-e2e 31.05% <ø> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Platform Backend 79.20% <98.70%> (-0.02%) ⬇️
Platform Frontend 37.42% <ø> (+0.03%) ⬆️
AutoGPT Libs ∅ <ø> (∅)
Classic AutoGPT 28.43% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
autogpt_platform/backend/backend/blocks/slack/blocks.py (1)

108-122: ⚡ Quick win

Non-standard try/except in run() — remove it per established block patterns.

The block framework's _execute() in _base.py already catches all uncaught exceptions from run() and converts them to BlockExecutionError. Catching here and re-raising as ValueError discards SlackAPIException.error's structured attribute and adds no value. The learnings for this codebase explicitly say not to add per-block try/except in run() unless you need to control partial output (which you don't here).

♻️ Proposed refactor
 async def run(
     self, input_data: Input, *, credentials: APIKeyCredentials, **kwargs
 ) -> BlockOutput:
-    try:
-        result = await self._post_message(
-            credentials=credentials,
-            channel=input_data.channel,
-            text=input_data.text,
-            thread_ts=input_data.thread_ts,
-            username=input_data.username,
-            icon_emoji=input_data.icon_emoji,
-            unfurl_links=input_data.unfurl_links,
-            mrkdwn=input_data.mrkdwn,
-        )
-        yield "ts", result.ts
-        yield "channel", result.channel
-    except Exception as e:
-        raise ValueError(f"Failed to send Slack message: {e}") from e
+    result = await self._post_message(
+        credentials=credentials,
+        channel=input_data.channel,
+        text=input_data.text,
+        thread_ts=input_data.thread_ts,
+        username=input_data.username,
+        icon_emoji=input_data.icon_emoji,
+        unfurl_links=input_data.unfurl_links,
+        mrkdwn=input_data.mrkdwn,
+    )
+    yield "ts", result.ts
+    yield "channel", result.channel

Based on learnings: "Do not add per-block try/except in individual block run() methods, as this is not the established pattern (e.g., Gmail, Slack, Todoist blocks omit it). The block framework's _execute() in _base.py already catches unhandled exceptions."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@autogpt_platform/backend/backend/blocks/slack/blocks.py` around lines 108 -
122, Remove the per-block try/except in the run() method so exceptions from
self._post_message propagate to the block framework; specifically, delete the
try/except that catches Exception and raises ValueError, call self._post_message
directly, and yield "ts" and "channel" from the returned result (preserving
result.ts and result.channel); this preserves SlackAPIException.error and lets
_execute() convert uncaught errors to BlockExecutionError rather than wrapping
them in ValueError.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/docs-claude-review.yml:
- Around line 16-19: Update the stale comment above the workflow conditional to
match the actual `if` expression (which checks
`github.event.pull_request.author_association == 'OWNER' ||
github.event.pull_request.author_association == 'MEMBER'`): replace "Only run
for PRs from members/collaborators" with a concise, accurate message such as
"Only run for PRs from repository OWNERs or MEMBERs" (or similar wording) so the
comment reflects the current condition.

In `@autogpt_platform/backend/backend/blocks/slack/_auth.py`:
- Around line 23-26: The concatenated description string for the Slack Bot Token
in _auth.py is missing a space between "required" and "OAuth"; update the
description (the description parameter/string for the Slack Bot Token) to
include a space either at the end of the preceding string or at the start of the
"OAuth scopes" string so it becomes "...add the required OAuth scopes...".
Ensure the corrected string is used where the description variable/argument is
defined.

In `@docs/integrations/block-integrations/slack/blocks.md`:
- Line 26: Update the table row for the "mrkdwn" field so the description
capitalizes "Markdown" (change "Enable Slack markdown formatting in the message
text." to "Enable Slack Markdown formatting in the message text."); locate the
"mrkdwn" entry in the blocks.md table and edit the description text accordingly
to use the proper noun "Markdown".

---

Nitpick comments:
In `@autogpt_platform/backend/backend/blocks/slack/blocks.py`:
- Around line 108-122: Remove the per-block try/except in the run() method so
exceptions from self._post_message propagate to the block framework;
specifically, delete the try/except that catches Exception and raises
ValueError, call self._post_message directly, and yield "ts" and "channel" from
the returned result (preserving result.ts and result.channel); this preserves
SlackAPIException.error and lets _execute() convert uncaught errors to
BlockExecutionError rather than wrapping them in ValueError.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6eea29c3-4228-4b23-a316-dca0be461f54

📥 Commits

Reviewing files that changed from the base of the PR and between 27624a6 and 7f6135b.

⛔ Files ignored due to path filters (1)
  • autogpt_platform/frontend/public/integrations/slack.png is excluded by !**/*.png
📒 Files selected for processing (11)
  • .github/workflows/claude.yml
  • .github/workflows/docs-claude-review.yml
  • autogpt_platform/backend/backend/blocks/slack/__init__.py
  • autogpt_platform/backend/backend/blocks/slack/_api.py
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/blocks/slack/_config.py
  • autogpt_platform/backend/backend/blocks/slack/blocks.py
  • autogpt_platform/backend/backend/integrations/providers.py
  • docs/integrations/README.md
  • docs/integrations/SUMMARY.md
  • docs/integrations/block-integrations/slack/blocks.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (15)
  • GitHub Check: check API types
  • GitHub Check: integration_test
  • GitHub Check: lint
  • GitHub Check: type-check (3.12)
  • GitHub Check: lint
  • GitHub Check: test (3.13)
  • GitHub Check: test (3.12)
  • GitHub Check: test (3.11)
  • GitHub Check: type-check (3.13)
  • GitHub Check: type-check (3.11)
  • GitHub Check: end-to-end tests
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (typescript)
  • GitHub Check: check-docs-sync
  • GitHub Check: Check PR Status
🧰 Additional context used
📓 Path-based instructions (5)
autogpt_platform/backend/**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/backend/**/*.py: Use Python 3.11 (required; managed by Poetry via pyproject.toml) for backend development
Always run 'poetry run format' (Black + isort) before linting in backend development
Always run 'poetry run lint' (ruff) after formatting in backend development

autogpt_platform/backend/**/*.py: Use poetry run ... command for executing Python package dependencies
Use top-level imports only — avoid local/inner imports except for lazy imports of heavy optional dependencies like openpyxl
Use absolute imports with from backend.module import ... for cross-package imports; single-dot relative imports are acceptable for sibling modules within the same package; avoid double-dot relative imports
Do not use duck typing — avoid hasattr/getattr/isinstance for type dispatch; use typed interfaces/unions/protocols instead
Use Pydantic models over dataclass/namedtuple/dict for structured data
Do not use linter suppressors — no # type: ignore, # noqa, # pyright: ignore; fix the type/code instead
Prefer list comprehensions over manual loop-and-append patterns
Use early return with guard clauses first to avoid deep nesting
Use %s for deferred interpolation in debug log statements for efficiency; use f-strings elsewhere for readability (e.g., logger.debug("Processing %s items", count) vs logger.info(f"Processing {count} items"))
Sanitize error paths by using os.path.basename() in error messages to avoid leaking directory structure
Be aware of TOCTOU (Time-Of-Check-Time-Of-Use) issues — avoid check-then-act patterns for file access and credit charging
Use transaction=True for Redis pipelines to ensure atomicity on multi-step operations
Use max(0, value) guards for computed values that should never be negative
Keep files under ~300 lines; if a file grows beyond this, split by responsibility (extract helpers, models, or a sub-module into a new file)
Keep functions under ~40 lines; extract named helpers when a function grows longer
...

Files:

  • autogpt_platform/backend/backend/blocks/slack/_config.py
  • autogpt_platform/backend/backend/blocks/slack/blocks.py
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/integrations/providers.py
  • autogpt_platform/backend/backend/blocks/slack/_api.py
autogpt_platform/backend/backend/blocks/**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/backend/backend/blocks/**/*.py: Inherit from 'Block' base class with input/output schemas when adding new blocks in backend
Implement 'run' method with proper error handling in backend blocks
Generate block UUID using 'uuid.uuid4()' when creating new blocks in backend
Write tests alongside block implementation when adding new blocks in backend

autogpt_platform/backend/backend/blocks/**/*.py: For blocks handling files, use store_media_file() with return_format="for_local_processing" when processing with local tools (ffmpeg, MoviePy, PIL)
For blocks handling files, use store_media_file() with return_format="for_external_api" when sending content to external APIs (Replicate, OpenAI)
For blocks returning files, use store_media_file() with return_format="for_block_output" to enable auto-adaptation to execution context (workspace:// in CoPilot, data URI in graphs)
When creating new blocks, inherit from Block base class, define input/output schemas using BlockSchema, implement async run method, and generate unique block ID using uuid.uuid4()

Files:

  • autogpt_platform/backend/backend/blocks/slack/_config.py
  • autogpt_platform/backend/backend/blocks/slack/blocks.py
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/blocks/slack/_api.py
autogpt_platform/{backend,autogpt_libs}/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Format Python code with poetry run format

Files:

  • autogpt_platform/backend/backend/blocks/slack/_config.py
  • autogpt_platform/backend/backend/blocks/slack/blocks.py
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/integrations/providers.py
  • autogpt_platform/backend/backend/blocks/slack/_api.py
autogpt_platform/backend/backend/blocks/**/_config.py

📄 CodeRabbit inference engine (autogpt_platform/backend/AGENTS.md)

When adding a new block, configure the provider using ProviderBuilder in _config.py

Files:

  • autogpt_platform/backend/backend/blocks/slack/_config.py
docs/integrations/**/*.md

📄 CodeRabbit inference engine (docs/AGENTS.md)

docs/integrations/**/*.md: Block documentation how_it_works manual section should provide a technical explanation of the block's processing logic in 1-2 paragraphs, mention validation/error handling/edge cases, and use code examples with backticks
Block documentation use_case manual section should provide exactly 3 practical use cases in bold heading format with short one-sentence descriptions
Documentation descriptions should be concise and action-oriented, focusing on practical real-world scenarios with consistent terminology and avoiding overly technical jargon

Files:

  • docs/integrations/block-integrations/slack/blocks.md
  • docs/integrations/README.md
  • docs/integrations/SUMMARY.md
🧠 Learnings (13)
📚 Learning: 2026-02-05T04:11:00.596Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 11796
File: autogpt_platform/backend/backend/blocks/video/concat.py:3-4
Timestamp: 2026-02-05T04:11:00.596Z
Learning: In autogpt_platform/backend/backend/blocks/**/*.py, when creating a new block, generate a UUID once with uuid.uuid4() and hard-code the resulting string as the block's id parameter. Do not call uuid.uuid4() at runtime; IDs must be constant across all imports and runs to ensure stability.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/_config.py
  • autogpt_platform/backend/backend/blocks/slack/blocks.py
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/blocks/slack/_api.py
📚 Learning: 2026-03-16T16:32:21.686Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 12417
File: autogpt_platform/backend/backend/blocks/agent_mail/pods.py:62-74
Timestamp: 2026-03-16T16:32:21.686Z
Learning: In autogpt_platform/backend/backend/blocks/, the Block base class execute() already wraps run() in a try/except to convert uncaught exceptions into BlockExecutionError/BlockUnknownError. Do not add per-block try/except in individual block run() methods, as this is not the established pattern (e.g., Gmail, Slack, Todoist blocks omit it). Only use explicit try/except within blocks that need to distinguish between success and error yield paths inside a generator (e.g., attachment blocks). This guidance applies to all Python files under autogpt_platform/backend/backend/blocks/ and similar block implementations; avoid duplicating error handling in run() unless a block requires generator-based branching.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/_config.py
  • autogpt_platform/backend/backend/blocks/slack/blocks.py
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/blocks/slack/_api.py
📚 Learning: 2026-04-23T12:55:26.122Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12893
File: autogpt_platform/backend/backend/blocks/ayrshare/post_to_tiktok.py:24-24
Timestamp: 2026-04-23T12:55:26.122Z
Learning: Cost billing via the cost(*costs) decorator is applied at input-evaluation time (before a block’s run() executes). Therefore, mutating input_data inside run() will not change billing. When a block’s billing depends on a field plus URL/sniff-derived signals, treat the explicitly declared billing field (e.g., is_video) as the only billing source—set it correctly before run() (or in the code path that occurs before the decorator evaluates input_data). This should be checked for all blocks under autogpt_platform/backend/backend/blocks/ so billing signals are not mistakenly assumed to update during run().

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/_config.py
  • autogpt_platform/backend/backend/blocks/slack/blocks.py
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/blocks/slack/_api.py
📚 Learning: 2026-02-26T17:02:22.448Z
Learnt from: Pwuts
Repo: Significant-Gravitas/AutoGPT PR: 12211
File: .pre-commit-config.yaml:160-179
Timestamp: 2026-02-26T17:02:22.448Z
Learning: Keep the pre-commit hook pattern broad for autogpt_platform/backend to ensure OpenAPI schema changes are captured. Do not narrow to backend/api/ alone, since the generated schema depends on Pydantic models across multiple directories (backend/data/, backend/blocks/, backend/copilot/, backend/integrations/, backend/util/). Narrowing could miss schema changes and cause frontend type desynchronization.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/_config.py
  • autogpt_platform/backend/backend/blocks/slack/blocks.py
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/integrations/providers.py
  • autogpt_platform/backend/backend/blocks/slack/_api.py
📚 Learning: 2026-03-05T15:42:08.207Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 12297
File: .claude/skills/backend-check/SKILL.md:14-16
Timestamp: 2026-03-05T15:42:08.207Z
Learning: In Python files under autogpt_platform/backend (recursively), rely on poetry run format to perform formatting (Black + isort) and linting (ruff). Do not run poetry run lint as a separate step after poetry run format, since format already includes linting checks.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/_config.py
  • autogpt_platform/backend/backend/blocks/slack/blocks.py
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/integrations/providers.py
  • autogpt_platform/backend/backend/blocks/slack/_api.py
📚 Learning: 2026-03-16T16:30:11.452Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 12417
File: autogpt_platform/backend/backend/blocks/agent_mail/threads.py:80-102
Timestamp: 2026-03-16T16:30:11.452Z
Learning: In autogpt_platform/backend/backend/blocks/ (and related blocks under autogpt_platform/backend/backend/blocks/), do not add try/except blocks around a block's run() method for standard error propagation. The block executor framework (backend/executor/manager.py) catches uncaught exceptions from run() and emits them on the 'error' output. Only add explicit try/except blocks when you need to control partial outputs in failure cases (e.g., certain outputs must not be yielded on error, as in attachment blocks). This is the standard pattern across the codebase; apply it broadly to blocks' run() implementations.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/_config.py
  • autogpt_platform/backend/backend/blocks/slack/blocks.py
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/blocks/slack/_api.py
📚 Learning: 2026-03-16T16:30:23.196Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 12417
File: autogpt_platform/backend/backend/blocks/agent_mail/pods.py:62-74
Timestamp: 2026-03-16T16:30:23.196Z
Learning: In any Python file under autogpt_platform/backend/backend/blocks, do not add a try/except around run() solely for standard error handling. The block framework’s _execute() in _base.py already catches unhandled exceptions and re-raises as BlockExecutionError or BlockUnknownError. If you yield ("error", message), _execute() raises BlockExecutionError immediately, so the error port will not propagate downstream. Reserve explicit try/except for scenarios where you must control partial output (e.g., attachment blocks that must skip yielding content_base64 on failure).

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/_config.py
  • autogpt_platform/backend/backend/blocks/slack/blocks.py
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/blocks/slack/_api.py
📚 Learning: 2026-03-16T16:30:11.452Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 12417
File: autogpt_platform/backend/backend/blocks/agent_mail/threads.py:80-102
Timestamp: 2026-03-16T16:30:11.452Z
Learning: Do not wrap synchronous AgentMail SDK calls with asyncio.to_thread() in blocks under autogpt_platform/backend/backend/blocks (and across the codebase). The block executor runs node execution in dedicated threads via asyncio.run_coroutine_threadsafe (see manager.py around lines ~745-752 and ~1079). The existing pattern avoids using asyncio.to_thread for SDK calls inside async run() methods, so maintain that approach and do not add to_thread usage in these code paths.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/_config.py
  • autogpt_platform/backend/backend/blocks/slack/blocks.py
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/blocks/slack/_api.py
📚 Learning: 2026-03-16T16:35:40.236Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12440
File: autogpt_platform/backend/backend/api/features/workflow_import.py:54-63
Timestamp: 2026-03-16T16:35:40.236Z
Learning: Avoid using the word 'competitor' in public-facing identifiers and text. Use neutral naming for API paths, model names, function names, and UI text. Examples: rename 'CompetitorFormat' to 'SourcePlatform', 'convert_competitor_workflow' to 'convert_workflow', '/competitor-workflow' to '/workflow'. Apply this guideline to files under autogpt_platform/backend and autogpt_platform/frontend.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/_config.py
  • autogpt_platform/backend/backend/blocks/slack/blocks.py
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/integrations/providers.py
  • autogpt_platform/backend/backend/blocks/slack/_api.py
📚 Learning: 2026-03-31T15:37:38.626Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12623
File: autogpt_platform/backend/backend/copilot/tools/agent_generator/fixer.py:37-47
Timestamp: 2026-03-31T15:37:38.626Z
Learning: When validating/constructing Anthropic API model IDs in Significant-Gravitas/AutoGPT, allow the hyphen-separated Claude Opus 4.6 model ID `claude-opus-4-6` (it corresponds to `LlmModel.CLAUDE_4_6_OPUS` in `autogpt_platform/backend/backend/blocks/llm.py`). Do NOT require the dot-separated form in Anthropic contexts. Only OpenRouter routing variants should use the dot separator (e.g., `anthropic/claude-opus-4.6`); `claude-opus-4-6` should be treated as correct when passed to Anthropic, and flagged only if it’s used in the OpenRouter path where the dot form is expected.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/_config.py
  • autogpt_platform/backend/backend/blocks/slack/blocks.py
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/integrations/providers.py
  • autogpt_platform/backend/backend/blocks/slack/_api.py
📚 Learning: 2026-04-15T02:43:36.890Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 12780
File: autogpt_platform/backend/backend/copilot/tools/workspace_files.py:0-0
Timestamp: 2026-04-15T02:43:36.890Z
Learning: When reviewing Python exception handlers, do not flag `isinstance(e, X)` checks as dead/unreachable if the caught exception `X` is a subclass of the exception type being handled. For example, if `X` (e.g., `VirusScanError`) inherits from `ValueError` (directly or via an intermediate class) and it can be raised within an `except ValueError:` block, then `isinstance(e, X)` inside that handler is reachable and should not be treated as dead code.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/_config.py
  • autogpt_platform/backend/backend/blocks/slack/blocks.py
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/integrations/providers.py
  • autogpt_platform/backend/backend/blocks/slack/_api.py
📚 Learning: 2026-04-22T11:46:04.431Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12881
File: autogpt_platform/backend/backend/copilot/config.py:0-0
Timestamp: 2026-04-22T11:46:04.431Z
Learning: Do not flag the Claude Sonnet 4.6 model ID as incorrect when it uses the project’s established hyphenated convention: `anthropic/claude-sonnet-4-6`. This hyphen form is the intentional, production convention and should be treated as valid (including in files like llm.py, blocks tests, reasoning.py, `_is_anthropic_model` tests, and config defaults). Note that OpenRouter also accepts the dot variant `anthropic/claude-sonnet-4.6`, so either form may be tolerated, but `anthropic/claude-sonnet-4-6` should be considered the standard to match project usage.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/_config.py
  • autogpt_platform/backend/backend/blocks/slack/blocks.py
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/integrations/providers.py
  • autogpt_platform/backend/backend/blocks/slack/_api.py
📚 Learning: 2026-04-22T11:46:12.892Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12881
File: autogpt_platform/backend/backend/copilot/baseline/service.py:322-332
Timestamp: 2026-04-22T11:46:12.892Z
Learning: In this codebase (Significant-Gravitas/AutoGPT), OpenRouter-routed Anthropic model IDs should use the hyphen-separated convention (e.g., `anthropic/claude-sonnet-4-6`, `anthropic/claude-opus-4-6`). Although OpenRouter may accept both hyphen and dot variants, treat the hyphen-separated form as the intended, correct codebase-wide convention and do not flag it as an error. Only flag the dot-separated variant (e.g., `anthropic/claude-sonnet-4.6`) as incorrect when reviewing/validating model ID strings for OpenRouter-routed Anthropic models.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/_config.py
  • autogpt_platform/backend/backend/blocks/slack/blocks.py
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/integrations/providers.py
  • autogpt_platform/backend/backend/blocks/slack/_api.py
🪛 LanguageTool
docs/integrations/block-integrations/slack/blocks.md

[uncategorized] ~26-~26: Did you mean the formatting language “Markdown” (= proper noun)?
Context: .... | bool | No | | mrkdwn | Enable Slack markdown formatting in the message text. | bool ...

(MARKDOWN_NNP)

🔇 Additional comments (7)
.github/workflows/claude.yml (1)

15-28: LGTM — gating change is consistent and correct.

Removing COLLABORATOR from the author_association check mirrors the same change made in docs-claude-review.yml, and the remaining multi-event condition structure is logically sound.

autogpt_platform/backend/backend/integrations/providers.py (1)

48-48: LGTM — ProviderName.SLACK correctly positioned and consistently valued.

autogpt_platform/backend/backend/blocks/slack/_config.py (1)

1-10: LGTM — provider registration correctly wired to "api_key" auth type.

autogpt_platform/backend/backend/blocks/slack/_api.py (1)

36-65: LGTM — call_slack_api correctly validates the ok flag and raises a typed exception.

docs/integrations/README.md (1)

357-357: LGTM — entry correctly placed and link/description match the block.

docs/integrations/SUMMARY.md (1)

108-108: LGTM — TOC entry is correctly placed alphabetically.

autogpt_platform/backend/backend/blocks/slack/blocks.py (1)

97-102: ⚡ Quick win

The framework properly handles this case. The test utility (autogpt_platform/backend/backend/util/test.py, lines 122-142) detects when the target method is async using inspect.iscoroutinefunction() and wraps synchronous mock values in an async def coroutine before patching. When await self._post_message(...) is called, it awaits the wrapper, which internally invokes the synchronous lambda and returns its result. No issue here.

Comment thread .github/workflows/docs-claude-review.yml
Comment thread autogpt_platform/backend/backend/blocks/slack/_auth.py
Comment thread docs/integrations/block-integrations/slack/blocks.md
ntindle

This comment was marked as low quality.

@github-project-automation github-project-automation Bot moved this from 🆕 Needs initial review to 🚧 Needs work in AutoGPT development kanban May 5, 2026
@ntindle
ntindle self-requested a review May 5, 2026 19:43
@ntindle
ntindle dismissed their stale review May 5, 2026 19:43

bots not following rules

Comment thread autogpt_platform/backend/backend/blocks/slack/_auth.py
ntindle
ntindle previously approved these changes May 7, 2026
@github-project-automation github-project-automation Bot moved this from 🚧 Needs work to 👍🏼 Mergeable in AutoGPT development kanban May 7, 2026
@ntindle
ntindle enabled auto-merge May 7, 2026 04:19
@ntindle
ntindle force-pushed the feat/add-slack-blocks branch from 3035594 to 33f49fd Compare May 7, 2026 17:43
@github-actions github-actions Bot removed the size/l label May 7, 2026
omsharma0401 and others added 3 commits May 7, 2026 12:45
…lify block

- Remove unnecessary _config.py (ProviderBuilder not needed for API-key-only providers)
- Fix missing space in _auth.py credentials description
- Remove redundant try/except in blocks.py
- Capitalize 'Markdown' in docs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Tests cover:
- SlackAPIException (inheritance, error code, message format)
- SlackMessageResult (basic fields, extra fields)
- call_slack_api (success, API error, unknown error, empty data)
- post_message (basic, optional params, omitted params, error propagation)
- SendSlackMessageBlock (UUID, category, schemas, run yields, param passing,
  error wrapping, generic exception wrapping, framework integration test)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ntindle
ntindle previously approved these changes May 7, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
autogpt_platform/backend/backend/blocks/slack/slack_test.py (1)

246-247: ⚡ Quick win

Move local imports to module scope.

uuid, BlockCategory, and execute_block_test should be imported at top-level for consistency with backend rules.

Proposed fix
 from typing import Any
 from unittest.mock import AsyncMock, MagicMock, patch
 
 import pytest
+import uuid
 
+from backend.blocks._base import BlockCategory
 from backend.blocks.slack._api import (
     SlackAPIException,
     SlackMessageResult,
@@
 from backend.blocks.slack._auth import TEST_CREDENTIALS, TEST_CREDENTIALS_INPUT
 from backend.blocks.slack.blocks import SendSlackMessageBlock
+from backend.util.test import execute_block_test
@@
     def test_block_id_is_valid_uuid(self):
-        import uuid
-
         uuid.UUID(self.block.id, version=4)
@@
     def test_block_category(self):
-        from backend.blocks._base import BlockCategory
-
         assert BlockCategory.SOCIAL in self.block.categories
@@
     async def test_framework_test_mock_works(self):
         """Verify the test_mock fixture from __init__ works with execute_block_test."""
-        from backend.util.test import execute_block_test
-
         await execute_block_test(self.block)
As per coding guidelines, "Use top-level imports only — avoid local/inner imports except for lazy imports of heavy optional dependencies like `openpyxl`".

Also applies to: 251-252, 356-357

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@autogpt_platform/backend/backend/blocks/slack/slack_test.py` around lines 246
- 247, In slack_test.py move the local imports to module scope: import uuid and
import BlockCategory and execute_block_test at the top of the file instead of
inside test functions; locate uses of uuid, BlockCategory, and
execute_block_test (references around the current local imports and the tests
that call execute_block_test) and add the corresponding top-level import
statements so the tests no longer perform local/inner imports (also fix the
other occurrences noted around the 251-252 and 356-357 regions).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@autogpt_platform/backend/backend/blocks/slack/slack_test.py`:
- Around line 318-333: The tests in slack_test.py (notably
test_run_wraps_api_error_as_value_error and the similar case around lines
336-351) assert that block.run() converts exceptions into ValueError, which
forces per-block try/excepts; instead update the tests to expect the original
SlackAPIException to be propagated (or to assert that the executor/wrapper will
handle wrapping), e.g. replace the pytest.raises(ValueError, ...) with
pytest.raises(SlackAPIException, ...) or otherwise assert that run() does not
perform custom exception wrapping so the Block execute()/executor can manage
error wrapping. Ensure references point to the test function names
test_run_wraps_api_error_as_value_error and the analogous test at 336-351 and to
the patched method _post_message on self.block.
- Line 88: The test currently silences the type checker with "# type: ignore" on
the assertion "assert r.extra_field == 'hi'"; remove the suppressor and instead
assert the extra field via the model's explicit extra storage or serialized
output (e.g., inspect r.dict()/r.json() or use getattr on the response object)
so the check doesn't rely on an undefined attribute; update the assertion to
access the extra data through the model serialization API (for the object
referenced as r) and assert equality to "hi" without any linter suppressor.

---

Nitpick comments:
In `@autogpt_platform/backend/backend/blocks/slack/slack_test.py`:
- Around line 246-247: In slack_test.py move the local imports to module scope:
import uuid and import BlockCategory and execute_block_test at the top of the
file instead of inside test functions; locate uses of uuid, BlockCategory, and
execute_block_test (references around the current local imports and the tests
that call execute_block_test) and add the corresponding top-level import
statements so the tests no longer perform local/inner imports (also fix the
other occurrences noted around the 251-252 and 356-357 regions).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7f50eddc-ade4-4610-9de4-5f69bc33a771

📥 Commits

Reviewing files that changed from the base of the PR and between 7f6135b and 3f37bb1.

⛔ Files ignored due to path filters (1)
  • autogpt_platform/frontend/public/integrations/slack.png is excluded by !**/*.png
📒 Files selected for processing (6)
  • autogpt_platform/backend/backend/blocks/slack/__init__.py
  • autogpt_platform/backend/backend/blocks/slack/_api.py
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/blocks/slack/blocks.py
  • autogpt_platform/backend/backend/blocks/slack/slack_test.py
  • autogpt_platform/backend/backend/integrations/providers.py
✅ Files skipped from review due to trivial changes (3)
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/blocks/slack/blocks.py
  • autogpt_platform/backend/backend/blocks/slack/_api.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • autogpt_platform/backend/backend/integrations/providers.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: end-to-end tests
  • GitHub Check: lint
  • GitHub Check: integration_test
  • GitHub Check: test (3.11)
  • GitHub Check: lint
  • GitHub Check: test (3.13)
  • GitHub Check: type-check (3.12)
  • GitHub Check: type-check (3.13)
  • GitHub Check: type-check (3.11)
  • GitHub Check: test (3.12)
  • GitHub Check: Check PR Status
🧰 Additional context used
📓 Path-based instructions (4)
autogpt_platform/backend/**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/backend/**/*.py: Use Python 3.11 (required; managed by Poetry via pyproject.toml) for backend development
Always run 'poetry run format' (Black + isort) before linting in backend development
Always run 'poetry run lint' (ruff) after formatting in backend development

autogpt_platform/backend/**/*.py: Use poetry run ... command for executing Python package dependencies
Use top-level imports only — avoid local/inner imports except for lazy imports of heavy optional dependencies like openpyxl
Use absolute imports with from backend.module import ... for cross-package imports; single-dot relative imports are acceptable for sibling modules within the same package; avoid double-dot relative imports
Do not use duck typing — avoid hasattr/getattr/isinstance for type dispatch; use typed interfaces/unions/protocols instead
Use Pydantic models over dataclass/namedtuple/dict for structured data
Do not use linter suppressors — no # type: ignore, # noqa, # pyright: ignore; fix the type/code instead
Prefer list comprehensions over manual loop-and-append patterns
Use early return with guard clauses first to avoid deep nesting
Use %s for deferred interpolation in debug log statements for efficiency; use f-strings elsewhere for readability (e.g., logger.debug("Processing %s items", count) vs logger.info(f"Processing {count} items"))
Sanitize error paths by using os.path.basename() in error messages to avoid leaking directory structure
Be aware of TOCTOU (Time-Of-Check-Time-Of-Use) issues — avoid check-then-act patterns for file access and credit charging
Use transaction=True for Redis pipelines to ensure atomicity on multi-step operations
Use max(0, value) guards for computed values that should never be negative
Keep files under ~300 lines; if a file grows beyond this, split by responsibility (extract helpers, models, or a sub-module into a new file)
Keep functions under ~40 lines; extract named helpers when a function grows longer
...

Files:

  • autogpt_platform/backend/backend/blocks/slack/slack_test.py
autogpt_platform/backend/backend/blocks/**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/backend/backend/blocks/**/*.py: Inherit from 'Block' base class with input/output schemas when adding new blocks in backend
Implement 'run' method with proper error handling in backend blocks
Generate block UUID using 'uuid.uuid4()' when creating new blocks in backend
Write tests alongside block implementation when adding new blocks in backend

autogpt_platform/backend/backend/blocks/**/*.py: For blocks handling files, use store_media_file() with return_format="for_local_processing" when processing with local tools (ffmpeg, MoviePy, PIL)
For blocks handling files, use store_media_file() with return_format="for_external_api" when sending content to external APIs (Replicate, OpenAI)
For blocks returning files, use store_media_file() with return_format="for_block_output" to enable auto-adaptation to execution context (workspace:// in CoPilot, data URI in graphs)
When creating new blocks, inherit from Block base class, define input/output schemas using BlockSchema, implement async run method, and generate unique block ID using uuid.uuid4()

Files:

  • autogpt_platform/backend/backend/blocks/slack/slack_test.py
autogpt_platform/{backend,autogpt_libs}/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Format Python code with poetry run format

Files:

  • autogpt_platform/backend/backend/blocks/slack/slack_test.py
autogpt_platform/backend/**/*_test.py

📄 CodeRabbit inference engine (autogpt_platform/backend/AGENTS.md)

autogpt_platform/backend/**/*_test.py: Use pytest with snapshot testing for API responses
Colocate test files with source files using *_test.py naming convention
Mock at boundaries — mock where the symbol is used, not where it's defined; after refactoring, update mock targets to match new module paths
Use AsyncMock from unittest.mock for async functions in tests
When writing tests, use Test-Driven Development (TDD): write failing tests marked with @pytest.mark.xfail before implementation, then remove the marker once the implementation is complete
When creating snapshots in tests, use poetry run pytest path/to/test.py --snapshot-update; always review snapshot changes with git diff before committing

Files:

  • autogpt_platform/backend/backend/blocks/slack/slack_test.py
🧠 Learnings (13)
📚 Learning: 2026-02-05T04:11:00.596Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 11796
File: autogpt_platform/backend/backend/blocks/video/concat.py:3-4
Timestamp: 2026-02-05T04:11:00.596Z
Learning: In autogpt_platform/backend/backend/blocks/**/*.py, when creating a new block, generate a UUID once with uuid.uuid4() and hard-code the resulting string as the block's id parameter. Do not call uuid.uuid4() at runtime; IDs must be constant across all imports and runs to ensure stability.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/slack_test.py
📚 Learning: 2026-03-16T16:32:21.686Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 12417
File: autogpt_platform/backend/backend/blocks/agent_mail/pods.py:62-74
Timestamp: 2026-03-16T16:32:21.686Z
Learning: In autogpt_platform/backend/backend/blocks/, the Block base class execute() already wraps run() in a try/except to convert uncaught exceptions into BlockExecutionError/BlockUnknownError. Do not add per-block try/except in individual block run() methods, as this is not the established pattern (e.g., Gmail, Slack, Todoist blocks omit it). Only use explicit try/except within blocks that need to distinguish between success and error yield paths inside a generator (e.g., attachment blocks). This guidance applies to all Python files under autogpt_platform/backend/backend/blocks/ and similar block implementations; avoid duplicating error handling in run() unless a block requires generator-based branching.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/slack_test.py
📚 Learning: 2026-04-23T12:55:26.122Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12893
File: autogpt_platform/backend/backend/blocks/ayrshare/post_to_tiktok.py:24-24
Timestamp: 2026-04-23T12:55:26.122Z
Learning: Cost billing via the cost(*costs) decorator is applied at input-evaluation time (before a block’s run() executes). Therefore, mutating input_data inside run() will not change billing. When a block’s billing depends on a field plus URL/sniff-derived signals, treat the explicitly declared billing field (e.g., is_video) as the only billing source—set it correctly before run() (or in the code path that occurs before the decorator evaluates input_data). This should be checked for all blocks under autogpt_platform/backend/backend/blocks/ so billing signals are not mistakenly assumed to update during run().

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/slack_test.py
📚 Learning: 2026-02-26T17:02:22.448Z
Learnt from: Pwuts
Repo: Significant-Gravitas/AutoGPT PR: 12211
File: .pre-commit-config.yaml:160-179
Timestamp: 2026-02-26T17:02:22.448Z
Learning: Keep the pre-commit hook pattern broad for autogpt_platform/backend to ensure OpenAPI schema changes are captured. Do not narrow to backend/api/ alone, since the generated schema depends on Pydantic models across multiple directories (backend/data/, backend/blocks/, backend/copilot/, backend/integrations/, backend/util/). Narrowing could miss schema changes and cause frontend type desynchronization.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/slack_test.py
📚 Learning: 2026-03-05T15:42:08.207Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 12297
File: .claude/skills/backend-check/SKILL.md:14-16
Timestamp: 2026-03-05T15:42:08.207Z
Learning: In Python files under autogpt_platform/backend (recursively), rely on poetry run format to perform formatting (Black + isort) and linting (ruff). Do not run poetry run lint as a separate step after poetry run format, since format already includes linting checks.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/slack_test.py
📚 Learning: 2026-03-16T16:30:11.452Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 12417
File: autogpt_platform/backend/backend/blocks/agent_mail/threads.py:80-102
Timestamp: 2026-03-16T16:30:11.452Z
Learning: In autogpt_platform/backend/backend/blocks/ (and related blocks under autogpt_platform/backend/backend/blocks/), do not add try/except blocks around a block's run() method for standard error propagation. The block executor framework (backend/executor/manager.py) catches uncaught exceptions from run() and emits them on the 'error' output. Only add explicit try/except blocks when you need to control partial outputs in failure cases (e.g., certain outputs must not be yielded on error, as in attachment blocks). This is the standard pattern across the codebase; apply it broadly to blocks' run() implementations.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/slack_test.py
📚 Learning: 2026-03-16T16:30:23.196Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 12417
File: autogpt_platform/backend/backend/blocks/agent_mail/pods.py:62-74
Timestamp: 2026-03-16T16:30:23.196Z
Learning: In any Python file under autogpt_platform/backend/backend/blocks, do not add a try/except around run() solely for standard error handling. The block framework’s _execute() in _base.py already catches unhandled exceptions and re-raises as BlockExecutionError or BlockUnknownError. If you yield ("error", message), _execute() raises BlockExecutionError immediately, so the error port will not propagate downstream. Reserve explicit try/except for scenarios where you must control partial output (e.g., attachment blocks that must skip yielding content_base64 on failure).

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/slack_test.py
📚 Learning: 2026-03-16T16:30:11.452Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 12417
File: autogpt_platform/backend/backend/blocks/agent_mail/threads.py:80-102
Timestamp: 2026-03-16T16:30:11.452Z
Learning: Do not wrap synchronous AgentMail SDK calls with asyncio.to_thread() in blocks under autogpt_platform/backend/backend/blocks (and across the codebase). The block executor runs node execution in dedicated threads via asyncio.run_coroutine_threadsafe (see manager.py around lines ~745-752 and ~1079). The existing pattern avoids using asyncio.to_thread for SDK calls inside async run() methods, so maintain that approach and do not add to_thread usage in these code paths.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/slack_test.py
📚 Learning: 2026-03-16T16:35:40.236Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12440
File: autogpt_platform/backend/backend/api/features/workflow_import.py:54-63
Timestamp: 2026-03-16T16:35:40.236Z
Learning: Avoid using the word 'competitor' in public-facing identifiers and text. Use neutral naming for API paths, model names, function names, and UI text. Examples: rename 'CompetitorFormat' to 'SourcePlatform', 'convert_competitor_workflow' to 'convert_workflow', '/competitor-workflow' to '/workflow'. Apply this guideline to files under autogpt_platform/backend and autogpt_platform/frontend.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/slack_test.py
📚 Learning: 2026-03-31T15:37:38.626Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12623
File: autogpt_platform/backend/backend/copilot/tools/agent_generator/fixer.py:37-47
Timestamp: 2026-03-31T15:37:38.626Z
Learning: When validating/constructing Anthropic API model IDs in Significant-Gravitas/AutoGPT, allow the hyphen-separated Claude Opus 4.6 model ID `claude-opus-4-6` (it corresponds to `LlmModel.CLAUDE_4_6_OPUS` in `autogpt_platform/backend/backend/blocks/llm.py`). Do NOT require the dot-separated form in Anthropic contexts. Only OpenRouter routing variants should use the dot separator (e.g., `anthropic/claude-opus-4.6`); `claude-opus-4-6` should be treated as correct when passed to Anthropic, and flagged only if it’s used in the OpenRouter path where the dot form is expected.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/slack_test.py
📚 Learning: 2026-04-15T02:43:36.890Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 12780
File: autogpt_platform/backend/backend/copilot/tools/workspace_files.py:0-0
Timestamp: 2026-04-15T02:43:36.890Z
Learning: When reviewing Python exception handlers, do not flag `isinstance(e, X)` checks as dead/unreachable if the caught exception `X` is a subclass of the exception type being handled. For example, if `X` (e.g., `VirusScanError`) inherits from `ValueError` (directly or via an intermediate class) and it can be raised within an `except ValueError:` block, then `isinstance(e, X)` inside that handler is reachable and should not be treated as dead code.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/slack_test.py
📚 Learning: 2026-04-22T11:46:04.431Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12881
File: autogpt_platform/backend/backend/copilot/config.py:0-0
Timestamp: 2026-04-22T11:46:04.431Z
Learning: Do not flag the Claude Sonnet 4.6 model ID as incorrect when it uses the project’s established hyphenated convention: `anthropic/claude-sonnet-4-6`. This hyphen form is the intentional, production convention and should be treated as valid (including in files like llm.py, blocks tests, reasoning.py, `_is_anthropic_model` tests, and config defaults). Note that OpenRouter also accepts the dot variant `anthropic/claude-sonnet-4.6`, so either form may be tolerated, but `anthropic/claude-sonnet-4-6` should be considered the standard to match project usage.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/slack_test.py
📚 Learning: 2026-04-22T11:46:12.892Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12881
File: autogpt_platform/backend/backend/copilot/baseline/service.py:322-332
Timestamp: 2026-04-22T11:46:12.892Z
Learning: In this codebase (Significant-Gravitas/AutoGPT), OpenRouter-routed Anthropic model IDs should use the hyphen-separated convention (e.g., `anthropic/claude-sonnet-4-6`, `anthropic/claude-opus-4-6`). Although OpenRouter may accept both hyphen and dot variants, treat the hyphen-separated form as the intended, correct codebase-wide convention and do not flag it as an error. Only flag the dot-separated variant (e.g., `anthropic/claude-sonnet-4.6`) as incorrect when reviewing/validating model ID strings for OpenRouter-routed Anthropic models.

Applied to files:

  • autogpt_platform/backend/backend/blocks/slack/slack_test.py

Comment thread autogpt_platform/backend/backend/blocks/slack/slack_test.py Outdated
Comment thread autogpt_platform/backend/backend/blocks/slack/slack_test.py Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/integrations/block-integrations/slack/blocks.md`:
- Line 13: Update the "How it works" section for the Slack block to include
explicit validation and error/edge-case behavior: describe that the block calls
Slack's chat.postMessage API with the bot token (mention `chat.postMessage`, the
returned `ts` and use as `thread_ts`), then list possible failures (invalid
token or missing `chat:write`/`chat:write.customize` scopes, unknown/invalid
channel, Slack returning non-`ok` responses or rate-limit errors) and how each
surfaces on block outputs (e.g., error status, error message field, and no `ts`
produced); keep it 1–2 paragraphs and include inline code spans for
`chat.postMessage`, `ts`, `thread_ts`, and typical error indicators so callers
know what to validate and expect.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 709b2256-4ea4-4cc7-a55c-62b095522ea2

📥 Commits

Reviewing files that changed from the base of the PR and between 3f37bb1 and c80db78.

📒 Files selected for processing (1)
  • docs/integrations/block-integrations/slack/blocks.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
  • GitHub Check: check API types
  • GitHub Check: lint
  • GitHub Check: integration_test
  • GitHub Check: check-overlaps
  • GitHub Check: types
  • GitHub Check: lint
  • GitHub Check: test (3.12)
  • GitHub Check: type-check (3.11)
  • GitHub Check: test (3.11)
  • GitHub Check: type-check (3.13)
  • GitHub Check: test (3.13)
  • GitHub Check: type-check (3.12)
  • GitHub Check: Analyze (python)
  • GitHub Check: check-docs-sync
  • GitHub Check: end-to-end tests
  • GitHub Check: Check PR Status
  • GitHub Check: Analyze (typescript)
🧰 Additional context used
📓 Path-based instructions (1)
docs/integrations/**/*.md

📄 CodeRabbit inference engine (docs/AGENTS.md)

docs/integrations/**/*.md: Block documentation how_it_works manual section should provide a technical explanation of the block's processing logic in 1-2 paragraphs, mention validation/error handling/edge cases, and use code examples with backticks
Block documentation use_case manual section should provide exactly 3 practical use cases in bold heading format with short one-sentence descriptions
Documentation descriptions should be concise and action-oriented, focusing on practical real-world scenarios with consistent terminology and avoiding overly technical jargon

Files:

  • docs/integrations/block-integrations/slack/blocks.md
🪛 LanguageTool
docs/integrations/block-integrations/slack/blocks.md

[uncategorized] ~26-~26: Did you mean the formatting language “Markdown” (= proper noun)?
Context: .... | bool | No | | mrkdwn | Enable Slack markdown formatting in the message text. | bool ...

(MARKDOWN_NNP)

Comment thread docs/integrations/block-integrations/slack/blocks.md
…ve docs

- Use model_extra instead of type: ignore in test_extra_fields_allowed
- Fix error propagation tests to match simplified run() (no try/except wrapper)
- Add error/edge-case behavior to docs how_it_works section

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
docs/integrations/block-integrations/slack/blocks.md (1)

28-28: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Capitalize “Markdown” in the mrkdwn description.

Use the proper noun capitalization for consistency with documentation terminology.

📝 Proposed fix
-| mrkdwn | Enable Slack markdown formatting in the message text. | bool | No |
+| mrkdwn | Enable Slack Markdown formatting in the message text. | bool | No |

As per coding guidelines, “Documentation descriptions should be concise and action-oriented, focusing on practical real-world scenarios with consistent terminology and avoiding overly technical jargon”.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/integrations/block-integrations/slack/blocks.md` at line 28, Update the
table entry for the Slack block option 'mrkdwn' to use proper noun
capitalization: change the description text from "Enable Slack markdown
formatting in the message text." to "Enable Slack Markdown formatting in the
message text." Locate the 'mrkdwn' row in the blocks.md table and edit only the
description string to capitalise "Markdown" for consistency with documentation
terminology.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@docs/integrations/block-integrations/slack/blocks.md`:
- Line 28: Update the table entry for the Slack block option 'mrkdwn' to use
proper noun capitalization: change the description text from "Enable Slack
markdown formatting in the message text." to "Enable Slack Markdown formatting
in the message text." Locate the 'mrkdwn' row in the blocks.md table and edit
only the description string to capitalise "Markdown" for consistency with
documentation terminology.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6cb646c0-c41d-41f9-83bf-64515f041818

📥 Commits

Reviewing files that changed from the base of the PR and between c80db78 and 5ab9713.

📒 Files selected for processing (3)
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
  • autogpt_platform/backend/backend/blocks/slack/slack_test.py
  • docs/integrations/block-integrations/slack/blocks.md
✅ Files skipped from review due to trivial changes (1)
  • autogpt_platform/backend/backend/blocks/slack/_auth.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • autogpt_platform/backend/backend/blocks/slack/slack_test.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: check API types
  • GitHub Check: lint
  • GitHub Check: integration_test
  • GitHub Check: end-to-end tests
  • GitHub Check: Analyze (python)
  • GitHub Check: Check PR Status
  • GitHub Check: check-overlaps
  • GitHub Check: type-check (3.12)
  • GitHub Check: test (3.13)
  • GitHub Check: test (3.12)
  • GitHub Check: test (3.11)
  • GitHub Check: type-check (3.11)
🧰 Additional context used
📓 Path-based instructions (1)
docs/integrations/**/*.md

📄 CodeRabbit inference engine (docs/AGENTS.md)

docs/integrations/**/*.md: Block documentation how_it_works manual section should provide a technical explanation of the block's processing logic in 1-2 paragraphs, mention validation/error handling/edge cases, and use code examples with backticks
Block documentation use_case manual section should provide exactly 3 practical use cases in bold heading format with short one-sentence descriptions
Documentation descriptions should be concise and action-oriented, focusing on practical real-world scenarios with consistent terminology and avoiding overly technical jargon

Files:

  • docs/integrations/block-integrations/slack/blocks.md
🪛 LanguageTool
docs/integrations/block-integrations/slack/blocks.md

[style] ~15-~15: Consider using a different verb for a more formal wording.
Context: ...lack error code so you can diagnose and fix the issue. Network failures and unexpec...

(FIX_RESOLVE)


[uncategorized] ~28-~28: Did you mean the formatting language “Markdown” (= proper noun)?
Context: .... | bool | No | | mrkdwn | Enable Slack markdown formatting in the message text. | bool ...

(MARKDOWN_NNP)

@ntindle
ntindle added this pull request to the merge queue May 7, 2026
Merged via the queue into Significant-Gravitas:dev with commit 11041d5 May 7, 2026
43 of 44 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Frontend May 7, 2026
@github-project-automation github-project-automation Bot moved this from 👍🏼 Mergeable to ✅ Done in AutoGPT development kanban May 7, 2026
itsababseh added a commit that referenced this pull request Jun 15, 2026
## AutoPilot Scheduling, New Design & Out of Beta

Changelog covering platform versions `v0.6.59` through `v0.6.63` (May 7
– June 10, 2026).

### Featured sections
- **AutoPilot major upgrades** — native scheduling (#13190),
self-distilled skills registry (#13195), message queuing (#12841)
- **New login & signup** — animated panel, aurora, integrations marquee
(#13169)
- **Subscriptions out of beta** — plans & payments fully live (#12935)
- **Settings rebuilt + profile dropdown** — cleaner layout, integrations
tab, quick-action menu (#13138, #12976)

### Improvements listed (not featured)
- Trigger On Anything (#12740)
- Export Chat as Markdown (#13070)
- Auto-open artifact panel (#12997)
- Slack block (#13008)
- Cost breakdown in briefing panel (#13129)
- Session sidebar pagination (#13128)
- Faster first response in AutoPilot (#12828)

### Files changed
- `docs/platform/changelog/may-7-june-10-2026.md` — new changelog page
- `docs/platform/.gitbook/assets/` — 5 new hero images
- `docs/platform/SUMMARY.md` — new entry at top
- `docs/platform/changelog/README.md` — new row at top of table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation platform/backend AutoGPT Platform - Back end platform/blocks platform/frontend AutoGPT Platform - Front end size/xl

Projects

Status: ✅ Done
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants