Skip to content

Conversation

@buremba
Copy link
Member

@buremba buremba commented Oct 26, 2025

Description

This PR introduces major new capabilities to Peerbot including file handling, Slack Assistant integration, and a comprehensive MCP OAuth authentication system.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Refactoring

Key Features Added

File Handling System

  • File Upload/Download API: New internal API routes with streaming support
  • Worker Authentication: Secure file operations using worker tokens with proper validation
  • Batch Operations: Support for uploading multiple files simultaneously
  • File Metadata: Complete file information tracking with proper MIME type handling

Slack Assistant Integration

  • Native UI Support: Full integration with Slack's Assistant interface
  • Suggested Prompts: Pre-configured prompts for better user experience
  • Thread Management: Proper handling of assistant threads with context preservation
  • Status Updates: Real-time status indicators during processing

Custom Tools for Workers

  • show_to_user Tool: Allows Claude workers to share files, visualizations, and documents with users
  • Automatic Upload: Seamless file sharing through Slack with proper metadata
  • Content Type Detection: Smart file type handling for various formats

MCP OAuth Enhancements

  • Automatic Discovery: OAuth endpoint discovery using RFC 8414/9728 standards
  • Dynamic Client Registration: Automatic OAuth app creation (RFC 7591)
  • Multiple Auth Patterns: Support for OAuth, API keys, input-based auth, and simple login URLs
  • Environment Variable Substitution: Secure credential management with ${env:VAR} syntax
  • Comprehensive Server Catalog: Pre-configured templates for GitHub, Google, Notion, Figma, and more

CLI Improvements

  • Simplified Initialization: Streamlined peerbot init with MCP server selection
  • Template Generation: Automatic Docker Compose and environment file creation
  • Example Configurations: Ready-to-use MCP server setups
  • Better Documentation: Comprehensive setup guides and troubleshooting

Testing

  • Verified file upload/download functionality works correctly
  • Tested Slack Assistant integration with native UI
  • Confirmed MCP OAuth flows work with multiple providers
  • Validated CLI init process generates proper configurations

Documentation Updates

  • MCP OAuth Guide: Comprehensive documentation in examples/mcp/README.md
  • CLI Examples: New example Peerbot setup in examples/my-peerbot/
  • API Documentation: Updated file handling API documentation
  • Configuration Guides: Step-by-step OAuth setup instructions

This PR significantly expands Peerbot's capabilities, making it a more complete solution for AI-powered Slack interactions with proper file handling and extensive third-party integrations through MCP.

…CP OAuth system

- Add file upload/download API routes with streaming support and worker authentication
- Implement Slack Assistant integration with native UI support and suggested prompts
- Create custom show_to_user tool for workers to share files via Slack
- Add comprehensive MCP OAuth system with automatic discovery and dynamic client registration
- Refactor CLI package with simplified init and MCP server management
- Add example configurations for MCP OAuth and custom Peerbot setups
- Simplify DevContainer configuration for faster setup
- Update documentation with comprehensive OAuth setup guides

This enables workers to handle files, integrates with Slack's Assistant UI, and provides a robust OAuth system for MCP servers with multiple authentication patterns.
@claude
Copy link
Contributor

claude bot commented Oct 26, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 132 to 137
// Determine if this is a new conversation
const isNewConversation = !context.threadTs || !existingSession;
// A conversation is new only if this message is the ROOT of the thread (messageTs === threadTs)
// OR if there's no thread_ts at all (first message in a channel/DM)
const isNewConversation =
context.messageTs === normalizedThreadTs && !existingSession;

Choose a reason for hiding this comment

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

P1 Badge New conversation detection ignores first replies in threads

The new logic now treats a request as a fresh conversation only when messageTs === normalizedThreadTs. This fails for the common case where a user first summons the bot by replying inside an existing Slack thread: thread_ts points to the root message, messageTs is different, and no prior session exists, so isNewConversation becomes false. The code then enqueues a follow‑up payload without ever deploying a worker, leaving the user message unhandled. The previous implementation simply checked !existingSession, which correctly bootstrapped a worker for first replies. Consider restoring the !existingSession guard so that the first message in any thread (root or reply) triggers deployment.

Useful? React with 👍 / 👎.

Comment on lines 8 to 9
"peerbot": "./bin/peerbot.js"
},

Choose a reason for hiding this comment

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

P1 Badge CLI package points to missing executable

The package manifest still declares a CLI entry at ./bin/peerbot.js, but this commit removes the bin directory entirely—there is no source or build output that produces that file. Installing or invoking @peerbot/cli will fail with “Cannot find module …/bin/peerbot.js” because the binary cannot be resolved. Update the bin field to point at a real script (e.g., dist/index.js) or restore a generated CLI entry before publishing.

Useful? React with 👍 / 👎.

@buremba buremba merged commit a3d6f3a into main Oct 26, 2025
8 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant