Skip to content

Add REPOST_TO_THREAD_AND_DELETE action for error-log-to-thread-and-delete reaction#16

Merged
alexeygrigorev merged 8 commits into
mainfrom
copilot/add-error-log-to-thread-action
Feb 6, 2026
Merged

Add REPOST_TO_THREAD_AND_DELETE action for error-log-to-thread-and-delete reaction#16
alexeygrigorev merged 8 commits into
mainfrom
copilot/add-error-log-to-thread-action

Conversation

Copilot AI commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

The error-log-to-thread-please reaction posts a reminder message but leaves the original error log in the channel. This adds a new action that reposts the original message to its thread, then deletes it from the channel to save space.

Changes

  • New action handler: REPOST_TO_THREAD_AND_DELETE in lambda_function.py

    • Retrieves original message content
    • Posts configurable message template to thread with original message quoted
    • Deletes message from channel (preserved in thread via repost)
    • Handles placeholders with channel-specific values and defaults
    • Escapes curly braces in user content to avoid format string conflicts
  • New reaction config: error-log-to-thread-and-delete in config.yaml

    • Configurable response template with {user_message}, {link}, {user}, {channel} placeholders
    • Channel-specific links for course-related channels with default fallback
  • Tests: 6 new test cases covering nominal flow and edge cases (missing message/user, placeholder matching failure, curly braces in content)

  • Documentation: Updated README with new action type and reaction description

Example Configuration

- reaction: error-log-to-thread-and-delete
  type: REPOST_TO_THREAD_AND_DELETE
  placeholders:
    link:
      course-ml-zoomcamp: https://github.com/.../asking-questions.md
      default: https://datatalks.club/slack/guidelines.html
  message: |
    Removing the message from the channel to save space. Please move the error log to the thread.
    
    Follow <{link}|these recommendations> to make it easier to help you.
    
    Here's the original message:
    
    > {user_message}

The original error-log-to-thread-please reaction remains unchanged for backward compatibility.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • slack.com
    • Triggering command: /usr/bin/python python test.py (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>New action for error-log-to-thread-please</issue_title>
<issue_description>Right now it simply responds to the thread. what I want to do instead:

  • Repost the original message (the one that started the thread) to the thread with the message "removing the message from the channel to save space. Please ... (use the original message from current implementation) Here's the original message: >"
  • Delete the message from the channel (but keep ones in the thread)

We will need to create a new action for that and new configuration. COnfigurable part: the response template </issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits February 6, 2026 08:18
Co-authored-by: alexeygrigorev <875246+alexeygrigorev@users.noreply.github.com>
Co-authored-by: alexeygrigorev <875246+alexeygrigorev@users.noreply.github.com>
Co-authored-by: alexeygrigorev <875246+alexeygrigorev@users.noreply.github.com>
Copilot AI changed the title [WIP] Add action for reposting error log to thread Add REPOST_TO_THREAD_AND_DELETE action for error-log-to-thread-and-delete reaction Feb 6, 2026
Copilot AI requested a review from alexeygrigorev February 6, 2026 08:22
@alexeygrigorev alexeygrigorev marked this pull request as ready for review February 6, 2026 08:53
@alexeygrigorev alexeygrigorev merged commit 3c1e558 into main Feb 6, 2026
1 check passed
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.

New action for error-log-to-thread-please

2 participants