- 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
- 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
- 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
- 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>