Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ repos:
entry: pytest -v tests/
language: system
types: [python]
stages: [push]
stages: [pre-push]
8 changes: 4 additions & 4 deletions src/dispatch/plugins/dispatch_slack/case/messages.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import logging
from typing import NamedTuple


from blockkit import (
Actions,
Button,
Expand Down Expand Up @@ -358,10 +357,11 @@ def create_genai_signal_message_metadata_blocks(
if isinstance(message, dict):
message = json_to_slack_format(message)

# Truncate the message if it exceeds Block Kit's maximum length
message = message[:2997] + "..." if len(message) > 3000 else message
# Truncate the text if it exceeds Block Kit's maximum length of 3000 characters
text = f":magic_wand: *GenAI Alert Analysis*\n\n{message}"
text = f"{text[:2997]}..." if len(text) > 3000 else text
signal_metadata_blocks.append(
Section(text=f":magic_wand: *GenAI Alert Analysis*\n\n{message}"),
Section(text=text),
)
signal_metadata_blocks.append(Divider())
return Message(blocks=signal_metadata_blocks).build()["blocks"]
Expand Down
Loading