- Added tenacity>=8.0.0 dependency for retry logic
- Created _invoke_agent_with_retry helper with @retry decorator
- Retries up to 3 times with exponential backoff (1-10 seconds)
- Retries only on ConnectionError and TimeoutError (transient)
- Graceful fallback to tool-less model on repeated failures
- Clarify multi-step execution scope: ReAct loop IS multi-step
- Reframe must_haves.truths to be user-observable behaviors
- Note orchestrator-worker patterns out of scope for demo
- Add _get_mcp_server_config() method for server configuration
- Initialize MCP client in on_activate() after model initialization
- Add async _handle_message_async() that uses create_react_agent with MCP tools
- Update _handle_openai_message and _handle_anthropic_message to use asyncio.run()
- Graceful fallback to basic model.invoke() when no MCP servers configured
Phase 17: MCP Client
- 1 plan in 1 wave
- Add langchain-mcp-adapters and langgraph dependencies
- Initialize MultiServerMCPClient on activation
- Convert handlers to async with create_react_agent
- Graceful fallback when no MCP servers configured
- Ready for execution
Tasks completed: 3/3
- Add threading to _send_response
- Build conversation history from thread
- Update handlers to use conversation history
SUMMARY: .planning/phases/16-session-memory/16-01-SUMMARY.md
- OpenAI handler now uses _build_conversation_history
- Anthropic handler now uses _build_conversation_history
- Both handlers determine root_id and pass to response methods
- Bot remembers previous messages in thread conversations
- Updated bot_id type hint to accept str | None
- Import AIMessage from langchain_core.messages
- Add _build_conversation_history method
- Fetches thread posts and converts to LangChain message types
- User posts become HumanMessage, bot posts become AIMessage
- Graceful fallback if thread fetch fails
- Added root_id parameter to _send_response method
- Added root_id parameter to _send_error_response method
- Post creation now includes root_id for threaded replies
- Replace _handle_openai_message with real LangChain model.invoke()
- Replace _handle_anthropic_message with real LangChain model.invoke()
- Add _send_response helper for posting messages
- Add _send_error_response helper for error messages
- Check for None model before invocation (missing API key)
- Wrap API calls in try/except with user-friendly error messages
- Add langchain, langchain-openai, langchain-anthropic to requirements.txt
- Import ChatOpenAI, ChatAnthropic, and message types
- Add openai_model and anthropic_model instance variables
- Initialize models in on_activate with error handling for missing API keys
Phase 15: LangChain Core
- 1 plan in 1 wave
- All autonomous (no checkpoints)
- User setup: OpenAI and Anthropic API keys required
- Ready for execution
Tasks completed: 3/3
- Create plugin structure with manifest
- Create plugin class with bot creation on activation
- Implement DM message routing
SUMMARY: .planning/phases/14-bot-infrastructure/14-01-SUMMARY.md
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add MessageHasBeenPosted hook for message routing
- Check channel type for DM detection
- Route messages based on bot membership in channel
- Add _handle_openai_message stub with placeholder response
- Add _handle_anthropic_message stub with placeholder response
- Include proper error handling for API calls
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create LangChainAgentPlugin class with OnActivate/OnDeactivate hooks
- Add OpenAI bot (langchain-openai-agent) creation
- Add Anthropic bot (langchain-anthropic-agent) creation
- Store bot IDs as instance attributes for message routing
- Include proper error handling and logging
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add plugin.json manifest with plugin metadata
- Add requirements.txt with placeholder for future LangChain deps
- Add Makefile with venv, dist, clean targets
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Created MILESTONES.md entry with accomplishments and stats
- Evolved PROJECT.md with validated requirements and current state
- Reorganized ROADMAP.md with milestone grouping
- Created milestone archive: milestones/v1.0-ROADMAP.md
- Updated STATE.md with milestone completion status
v1.0 Python Plugin Support shipped:
- 236 RPC methods for Plugin API
- 35+ hooks including ServeHTTP streaming
- Python SDK with typed client and decorator-based hooks
- Full server integration
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Phase 13 completed with 4 plans via parallel execution:
- 13-01: Architecture documentation (ARCHITECTURE.md)
- 13-02: Server Makefile gRPC tooling (proto-gen-all)
- 13-03: Example plugin Makefile and packaging (dist target)
- 13-04: CLAUDE.md files for agentic AI development
MILESTONE COMPLETE: All 13 phases finished
- 41 plans total across 13 phases
- Full API parity (236 RPC methods)
- Full hook parity (35+ hooks)
- Complete developer documentation and tooling
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add summary documenting creation of three CLAUDE.md files for agentic
AI development guidance targeting plugin developers, SDK maintainers,
and Mattermost contributors.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add AI development guidance for Mattermost contributors working on the
Python plugin gRPC infrastructure. Includes directory structure, key
components, proto organization, common patterns, and instructions for
adding new API methods and hooks.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add AI development guidance for SDK maintainers. Includes directory
structure, key components, development workflow, proto code generation,
and instructions for adding new hooks and API methods.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add AI development guidance for plugin developers using the hello_python
example as a template. Includes setup commands, architecture overview,
hook patterns, API usage, and best practices.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add ARCHITECTURE.md documenting the Python plugin gRPC system including:
- High-level overview and ASCII system architecture diagram
- Component layer documentation (Protocol, Go Infrastructure, Python SDK)
- Process lifecycle (loading, environment variables, shutdown)
- Communication flow diagrams (hooks, API calls, ServeHTTP streaming)
- Key design decisions (embedded AppError, 64KB chunks, APIServerRegistrar)
- Complete file reference table mapping functionality to source files
- Extension guide for adding new API methods and hooks
This documentation enables internal Mattermost engineers to understand,
debug, and extend the Python plugin infrastructure.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add summary for 13-02 plan execution:
- Task 1: Added python-proto-gen and proto-gen-all targets to server Makefile
- Task 2: Created Python SDK Makefile with venv, proto-gen, build, test, lint, clean targets
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add Makefile to python-sdk/ with targets for common development operations:
- venv: Create virtual environment and install dependencies
- proto-gen: Generate Python gRPC code from proto files
- build: Build SDK package (wheel and sdist)
- test: Run pytest test suite
- lint: Run mypy type checking
- clean: Remove build artifacts
- help: Show available targets
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add Makefile for hello_python example with development workflow targets:
- venv: Create virtual environment with SDK and dependencies
- install: Install/update dependencies in existing venv
- dist: Package plugin as tar.gz with vendored SDK
- dist-minimal: Package plugin without SDK (server must have SDK)
- clean: Remove build artifacts
- run: Run plugin locally for testing
- lint: Run type checking on plugin code
- help: Show available targets and development workflow
This Makefile serves as a template for Python plugin developers.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add python-proto-gen and proto-gen-all targets to server/public/Makefile
for complete gRPC code generation workflow:
- python-proto-gen: Generates Python gRPC code by calling generate_protos.py
- proto-gen-all: Runs both Go and Python proto generation in sequence
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>