[Bug]: RemoteConversation.send_message(sender=...) silently drops the sender that LocalConversation records

Open
#7,004 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Read the RemoteConversation.send_message path and the server's SendMessageRequest for POST /api/conversations/{id}/events, then compare them with LocalConversation's sender handling. The issue identifies a product decision about free-form labels versus verified conversation senders that must be resolved before implementation. Done means the remote path records the sender or raises, with live-server coverage and the goal runner, TaskManager, and delegate behavior tested or documented.

Written by the indexing model from the issue text.

Description

bug priority:medium

I'm an AI agent helping Engel Nyst (@enyst) with project work.

Is there an existing issue for the same bug?
  • I have searched existing issues and this is not a duplicate.
Bug Description

Conversation.send_message(message, sender=...) behaves differently on the two conversation kinds. LocalConversation saves the user MessageEvent with that sender; RemoteConversation posts {"sender": ...} to POST /api/conversations/{id}/events, whose body (SendMessageRequest) has no sender field (only sender_conversation_id, added in #6960). The server answers 200 and saves the message with sender: null, so the label is lost silently.

SDK callers that rely on it: the goal runner (send_message(..., sender="goal")), TaskManager and the delegate tool (sender=parent_name). On a remote conversation their messages are indistinguishable from the user's own.

This is a seam bug between the SDK and the server: the SDK map's S04.conversation-sender (local, passes) and the agent-server map's F06.send-sender-conversation (REST, passes for sender_conversation_id) both hold, but the remote client path between them drops the sender. Found by the daily feature-map pass; not a regression from 0275e714..1414239 (the server never had a sender field and the client code is unchanged in that range).

This needs a maintainer's product decision. The server deliberately only records senders it can vouch for (conversation:<hex> from an existing conversation, with a "[Sent by …]" header). Options I see:

  1. RemoteConversation maps conversation:<hex> senders to sender_conversation_id and raises ValueError for any other sender (no silent drop; callers like the goal runner would need another way to mark their messages remotely).
  2. The server accepts a free-form sender label from authenticated clients and records it as-is (distinct from the vouched conversation: form).
  3. RemoteConversation keeps dropping it but warns, and the docstring says so.
Expected Behavior

A sender passed to RemoteConversation.send_message is either recorded on the saved message as it is locally, or refused with an error; it is never silently discarded.

Actual Behavior

Local: [["goal", "QA_SEAM_LOCAL"]]. Remote, same program and SDK: [[null, "QA_SEAM_REMOTE"]]. The REST call returns 200.

Steps to Reproduce

On main@141423921fdaeb08cd5f53464a69e860da70b66f, with the verify-agent-server skill's CLI on PATH (.agents/skills/verify-agent-server/scripts):

uv sync --dev
export AGENT_SERVER_VERIFY_RUN=$(control-agent-server launch --new --name sender-seam --print-run)
export F=$AGENT_SERVER_VERIFY_RUN/fixtures/seam; mkdir -p $F
curl -sL https://raw.githubusercontent.com/enyst/openhands-evidence/128dce7746a4a625f149347e3f3075627d95dac2/software-agent-sdk/bugs/2026-11-19/remote-sender/seam.py -o $F/seam.py
control-agent-server exec --env F="$F" --save sender-seam/probe -- .venv/bin/python $F/seam.py   # prints SEAM_RESULT {...}
control-agent-server stop

REST-only form: control-agent-server api POST /api/conversations/$CID/events --json '{"role":"user","content":[{"type":"text","text":"x"}],"sender":"qa-x"}' returns 200, and GET /api/conversations/$CID/events/search shows the message with sender: null.

Acceptance Criteria

Once the option is chosen:

  • RemoteConversation.send_message(msg, sender=X) never results in a saved message with sender: null while returning normally: it records X (or its conversation: mapping) or raises.
  • A test runs the same send_message(..., sender=...) through LocalConversation and RemoteConversation against a live server and asserts the same outcome.
  • The goal runner, TaskManager and delegate tool behave as decided on remote conversations (covered by a test or documented).
Installation Method

From source (uv)

SDK Version

main@141423921fdaeb08cd5f53464a69e860da70b66f (openhands-sdk 1.62.0)

Version Confirmation
  • I have confirmed this bug exists on the LATEST version of OpenHands SDK
Python Version

3.13

Model Name (if applicable)

None (no model call; dummy LLM config)

Operating System

Linux

Logs and Error Messages

Saved exchange and program: [probe.json](https://github.com/enyst/openhands-evidence/blob/128dce7746a4a625f149347e3f3075627d95dac2/software-agent-sdk/bugs/2026-11-19/remote-sender/probe.json), seam.py, [README](https://github.com/enyst/openhands-evidence/blob/128dce7746a4a625f149347e3f3075627d95dac2/software-agent-sdk/bugs/2026-11-19/remote-sender/README.md).

Minimal Code Sample
remote = Conversation(agent=agent, workspace=RemoteWorkspace(host=url, api_key=key, working_dir=d))
remote.send_message("hi", sender="goal")
[e.sender for e in remote.state.events if isinstance(e, MessageEvent) and e.source == "user"]  # [None]; locally ["goal"]

Generated by Claude Code

Dominant language
Python
Stars
1.4k
Forks
797
Avg merge
1d 17h
Merged PRs (30d)
354

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenHands/software-agent-sdk

All issues in OpenHands/software-agent-sdk

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.