mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 20:53:15 +00:00
* feat: add GitHub PR comment trigger and reply support * refactor: improve readability of GitHub integration * linting * fix: resolve github token from thread metadata and improve PR trigger flow * fix: fall back to OAuth for GitHub webhook when no token in thread metadata * give me commit message github integeration working without a breaking * auth.py refactor * fix: validate cached GitHub token before use to handle expiry * liniting * ci unitest formatting * feat: post PR comments as GitHub App bot instead of user OAuth token * resolved comments * slack resolveed comments * Refactor docstring and comments in get_slack_repo_config Removed unnecessary comments and cleaned up docstring formatting. * cr * cr * cr * cr --------- Co-authored-by: bracesproul <braceasproul@gmail.com>
32 lines
1.1 KiB
Python
32 lines
1.1 KiB
Python
import asyncio
|
|
from typing import Any
|
|
|
|
from langgraph.config import get_config
|
|
|
|
from ..utils.slack import post_slack_thread_reply
|
|
|
|
|
|
def slack_thread_reply(message: str) -> dict[str, Any]:
|
|
"""Post a message to the current Slack thread.
|
|
|
|
Format messages using Slack's mrkdwn format, NOT standard Markdown.
|
|
Key differences: *bold*, _italic_, ~strikethrough~, <url|link text>,
|
|
bullet lists with "• ", ```code blocks```, > blockquotes.
|
|
Do NOT use **bold**, [link](url), or other standard Markdown syntax."""
|
|
config = get_config()
|
|
configurable = config.get("configurable", {})
|
|
slack_thread = configurable.get("slack_thread", {})
|
|
|
|
channel_id = slack_thread.get("channel_id")
|
|
thread_ts = slack_thread.get("thread_ts")
|
|
if not channel_id or not thread_ts:
|
|
return {
|
|
"success": False,
|
|
"error": "Missing slack_thread.channel_id or slack_thread.thread_ts in config",
|
|
}
|
|
|
|
if not message.strip():
|
|
return {"success": False, "error": "Message cannot be empty"}
|
|
|
|
success = asyncio.run(post_slack_thread_reply(channel_id, thread_ts, message))
|
|
return {"success": success}
|