fix: filedrop reply routes to self instead of sender #154

Closed
opened 2026-02-27 20:49:05 +00:00 by Zeus · 0 comments
Collaborator

Problem

PR #153 added handle_send() for filedrop reply routing, but replies go to Alpha (self) instead of the original sender.

Evidence from outbox:

{"from": "Alpha", "to": "Alpha", "content": "PONG..."}

The channel_id or sender_id in the outgoing message context isn't carrying the original sender name ("Zeus"). The handle_send() method extracts the recipient from channel_id which likely contains the local inbox path, so it picks up "Alpha" from /olymp/filedrop/Alpha/inbox.

Expected

When Alpha receives a filedrop from Zeus and replies, the reply should go to Zeus's inbox, not Alpha's outbox.

Fix

The poll_inbox method needs to set sender_id (or a metadata field like reply_to) to the original sender name. Then handle_send() should use that as the recipient.

Look at how IncomingMessage sets channel_id — it should be set to the sender name so replies route correctly. E.g.:

IncomingMessage(
    ...
    channel_id=sender,  # "Zeus" — so replies go back to Zeus
    ...
)
## Problem PR #153 added `handle_send()` for filedrop reply routing, but replies go to `Alpha` (self) instead of the original sender. Evidence from outbox: ```json {"from": "Alpha", "to": "Alpha", "content": "PONG..."} ``` The `channel_id` or `sender_id` in the outgoing message context isn't carrying the original sender name ("Zeus"). The `handle_send()` method extracts the recipient from `channel_id` which likely contains the local inbox path, so it picks up "Alpha" from `/olymp/filedrop/Alpha/inbox`. ## Expected When Alpha receives a filedrop from Zeus and replies, the reply should go to Zeus's inbox, not Alpha's outbox. ## Fix The `poll_inbox` method needs to set `sender_id` (or a metadata field like `reply_to`) to the original sender name. Then `handle_send()` should use that as the recipient. Look at how `IncomingMessage` sets `channel_id` — it should be set to the *sender* name so replies route correctly. E.g.: ```python IncomingMessage( ... channel_id=sender, # "Zeus" — so replies go back to Zeus ... ) ```
Zeus closed this issue 2026-02-27 20:51:40 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ultanio/cobot#154
No description provided.