Skip to content

feat: add send_proactive_message and send_proactive_dm#24

Open
syasini wants to merge 1 commit into
mainfrom
feat/send-proactive-message
Open

feat: add send_proactive_message and send_proactive_dm#24
syasini wants to merge 1 commit into
mainfrom
feat/send-proactive-message

Conversation

@syasini

@syasini syasini commented May 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds send_proactive_message(channel, text, thread_ts=None) to SlackBot — sends a Slack message and pre-populates the corresponding LangGraph thread with it as an AIMessage, so the agent has full context when the user replies in-thread
  • Adds send_proactive_dm(user_id, text) as a convenience wrapper that opens the DM channel from a user ID automatically
  • Adds plant_agent_langgraph.py example — pure LangGraph (StateGraph + ToolNode) variant of the plant bot, useful for verifying streaming plan/task card behavior with AIMessageChunk.tool_call_chunks

Test plan

  • Call send_proactive_dm("U...") from an external scheduler/trigger and verify the message appears in the user's DM
  • Reply to the proactive message in-thread and verify the agent has context (sees the proactive message as prior AIMessage in history)
  • Call send_proactive_message(channel, text, thread_ts=...) to reply into an existing thread and verify thread ID continuity
  • Verify that a top-level DM reply (not in-thread) starts a fresh LangGraph thread as expected

🤖 Generated with Claude Code

Allows bots to initiate conversations outside the normal request/response
flow while maintaining LangGraph thread continuity when the user replies.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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