open-swe/agent/utils/thread_ids.py
Ramon Nogueira 747ce4bbe5
feat: add Slack breakout thread tool (#1638)
* feat: add Slack breakout thread tool

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>

* chore: make fake LLM scripts declarative

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>

* fix: exclude slack_start_new_thread from plan mode

The breakout tool can dispatch a fresh agent run that starts outside the
current plan-mode state, bypassing the approval flow. Add it to
PLAN_MODE_EXCLUDED_TOOLS so it's hidden alongside the other mutating
tools while planning.

---------

Co-authored-by: Ramon Nogueira <270434257+ramon-langchain@users.noreply.github.com>
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
2026-06-29 13:16:54 -07:00

9 lines
336 B
Python

import hashlib
import uuid
def generate_thread_id_from_slack_thread(channel_id: str, thread_ts: str) -> str:
"""Generate a deterministic thread ID from a Slack thread identifier."""
composite = f"{channel_id}:{thread_ts}"
md5_hex = hashlib.md5(composite.encode("utf-8")).hexdigest()
return str(uuid.UUID(hex=md5_hex))