Skip to content

fix: slack file upload fallback loses thread context#1122

Merged
teknium1 merged 1 commit into
NousResearch:mainfrom
0xbyt4:fix/slack-fallback-metadata
Mar 13, 2026
Merged

fix: slack file upload fallback loses thread context#1122
teknium1 merged 1 commit into
NousResearch:mainfrom
0xbyt4:fix/slack-fallback-metadata

Conversation

@0xbyt4

@0xbyt4 0xbyt4 commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Summary

When Slack file uploads fail (API error, rate limit, etc.), the fallback paths in send_image_file, send_video, and send_document called super() without passing metadata. The base class then called self.send() without metadata, so Slack's send() method couldn't resolve the thread_ts — causing fallback messages to appear in the main channel instead of the thread.

Root cause

# Before (slack.py:445) — metadata lost
return await super().send_image_file(chat_id, image_path, caption, reply_to)

The base class send_image_file/send_video/send_document implementations call self.send(chat_id, text, reply_to=reply_to) without forwarding metadata. Since Slack resolves thread context from metadata["thread_id"], the thread_ts was silently dropped.

Fix

Replace super() fallback calls with direct self.send() calls that include metadata:

# After — thread context preserved
text = f"🖼️ Image: {image_path}"
if caption:
    text = f"{caption}\n{text}"
return await self.send(chat_id, text, reply_to=reply_to, metadata=metadata)

Applied to all three methods: send_image_file (line 445), send_video (line 552), send_document (line 590).

Test plan

  • test_send_image_file_fallback_preserves_thread — verifies thread_ts in fallback
  • test_send_video_fallback_preserves_thread — verifies thread_ts in fallback
  • test_send_document_fallback_preserves_thread — verifies thread_ts in fallback
  • test_send_image_file_fallback_includes_caption — verifies caption in fallback text
  • All 62 existing Slack tests pass

Fallback paths in send_image_file, send_video, and send_document called
super() without metadata, causing replies to appear outside the thread
when file upload fails. Use self.send() with metadata instead to preserve
thread_ts context.
@teknium1 teknium1 merged commit 28ffa8e into NousResearch:main Mar 13, 2026
1 check failed
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
fix: slack file upload fallback loses thread context
thewillhuang pushed a commit to thewillhuang/hermes-agent that referenced this pull request May 11, 2026
…olumn

Add 'review' as a valid task status and extend dispatch_once to
monitor the review column as a second dispatch source (in addition
to the existing ready column).

Changes:
- Add 'review' to VALID_STATUSES in kanban_db.py
- Add claim_review_task() for review->running transitions
- Add review dispatch loop in dispatch_once, sharing max_spawn
- Review agents get sdlc-review skill auto-loaded via task.skills
- Add has_spawnable_review() for health telemetry
- Update gateway _ready_nonempty to also check review tasks
- Add 14 tests covering claim, dispatch, skills, max_spawn, telemetry

Implements NousResearch#1125 / AC NousResearch#2 of epic NousResearch#1122.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
fix: slack file upload fallback loses thread context
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
fix: slack file upload fallback loses thread context
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
fix: slack file upload fallback loses thread context
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.

2 participants