feat(examples): Slack auto-fix agent — monitors channel and auto-creates PRs#135
Draft
manan164 wants to merge 3 commits into
Draft
feat(examples): Slack auto-fix agent — monitors channel and auto-creates PRs#135manan164 wants to merge 3 commits into
manan164 wants to merge 3 commits into
Conversation
Monitors a Slack channel for bug reports and autonomously: 1. Reads and classifies Slack messages (issue_reader) 2. Investigates root cause in the codebase (code_investigator) 3. Applies the fix (code_fixer) 4. Creates a branch, commits, pushes, opens a PR, and replies in Slack (pr_creator) Supports --dry-run (investigate only, no writes) and --loop (continuous polling). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bradyyie
previously approved these changes
May 12, 2026
bradyyie
left a comment
Collaborator
There was a problem hiding this comment.
LGTM — Well-documented Slack auto-fix agent example. Good demonstration of AgentSpan's sequential strategy for a real-world use case (Slack monitoring -> code investigation -> fix -> PR creation). Clear README, practical usage instructions, and proper env var handling.
Dismissing approval — need to properly reproduce bugs before approving. Re-reviewing with hands-on QA.
bradyyie
approved these changes
May 13, 2026
manan164
added a commit
that referenced
this pull request
Jun 15, 2026
…ention Follows the pattern in sdk/python/examples/91_slack_autofix_agent.py (per PR #135): poll the alert channel with conversations.history + reply via chat.postMessage using a bot token only — no slack_bolt / Socket Mode, no app-level token. Run-once or --loop, dedup via a local state file. Slack I/O lives in a deterministic poller; the triage agent stays pure (investigates a given execution id). Adds test_poller.py covering alert-only triage, cross-poll dedup, and failure reporting (fakes, no network/LLM; validated fail-then-pass per CLAUDE.md). Config: drop SLACK_APP_TOKEN; add SLACK_ALERT_CHANNEL (required), ONCALL_POLL_INTERVAL, ONCALL_STATE_FILE. requirements: drop slack-bolt, add requests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Adds
91_slack_autofix_agent.py— an autonomous engineering agent that monitors a Slack channel for bug reports and automatically investigates, fixes, and opens a GitHub PR.Architecture
Tools
fetch_slack_bug_reportssearch_codebasegrep -rnover the repo to find relevant coderead_file/write_filerun_git_commandcreate_branch_and_commitpush_branchcreate_github_prgh pr create— opens the PRmark_message_processedpost_slack_replyUsage
Why Agentspan for this
code_fixernever runs beforecode_investigatorcompletes🤖 Generated with Claude Code