Skip to content

fix: forward Slack image attachments to queued follow-up messages#1184

Open
Johan Bonilla (johanity) wants to merge 1 commit intolangchain-ai:mainfrom
johanity:johanity/fix-slack-image-queue-drop
Open

fix: forward Slack image attachments to queued follow-up messages#1184
Johan Bonilla (johanity) wants to merge 1 commit intolangchain-ai:mainfrom
johanity:johanity/fix-slack-image-queue-drop

Conversation

@johanity
Copy link
Copy Markdown

Description

Slack image attachments were silently dropped when a user sent a follow-up with an image while open-swe was already running on that thread.

process_slack_mention built the correct image_urls list from the thread context, but on the busy path hardcoded image_urls=[] in the queued payload:

# agent/webapp.py (before)
queued_payload = {"text": prompt, "image_urls": []}

check_message_queue_before_model then read an empty list and never fetched the images, so the agent saw the follow-up text but not the screenshot. Regression introduced in #1050.

The rest of the queue pipeline — including Slack-auth in fetch_image_block — was already wired correctly. Only the queue producer was missing the forward.

This PR also reorders process_slack_mention so the is_thread_active check runs before the image fetch loop. Previously, images were fetched from files.slack.com on the busy path even though the results were then discarded by the image_urls=[] queue payload.

On the busy path the queue now carries images filtered to the current mention only, not the full thread context. Re-injecting historical images would duplicate what the agent already saw in its prior turn.

Test Plan

New tests/test_slack_image_queue.py:

  • Busy path forwards current mention's image URL to the queue payload
  • Busy path excludes historical context images
  • Busy path produces empty image_urls for a text-only follow-up
  • Non-busy path still fetches images into content_blocks

Full suite: 111 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.

1 participant