OpenHands / OpenHands/software-agent-sdk
[Bug]: RemoteConversation.fork() ignores title in server response; test mocks wrong server shape
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 539
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 137
Description
Bug Description
Two related gaps, both pre-existing and surfaced while reviewing #4814:
1. RemoteConversation.fork() silently drops the fork title
The fork endpoint returns ConversationInfo, which has title and tags as separate top-level fields. But the client-side fork() implementation only reads fork_info.get("tags") from the response when constructing the new RemoteConversation — the title field is ignored entirely. So calling conv.fork(title="My Fork") correctly sends the title to the server (which stores it on StoredConversation), but the returned RemoteConversation object has no record of it.
2. test_remote_fork_uses_server_returned_tags mocks an impossible server shape
The test constructs server_tags = {"env": "test", "title": "My Fork"} and places the whole dict inside the mock response's "tags" key — as if the server returns title inside tags. The real server never does this; title and tags are separate fields on ConversationInfo.
Expected Behavior
RemoteConversation.fork(title="My Fork") returns a fork object that reflects the title the server assigned. The mock in test_remote_fork_uses_server_returned_tags matches the real server response shape, with title as a separate top-level field.
Actual Behavior
The title is sent to and stored by the server correctly, but is silently discarded when RemoteConversation is constructed from the response.
The existing test passes despite mocking an impossible server shape. You can observe this by inspecting what the mock returns vs. what ConversationInfo actually looks like:
uv run pytest tests/sdk/conversation/remote/test_remote_fork.py::test_remote_fork_uses_server_returned_tags -v -s
The test passes, but server_tags includes "title" as a tag key — a shape the real server (ConversationInfo in models.py) never emits. The stale comment in remote_conversation.py that says the server response tags "include merged title" documents this incorrect assumption.
Acceptance Criteria
-
RemoteConversation.fork()readstitlefrom the server response and surfaces it on the returned fork object -
test_remote_fork_uses_server_returned_tagsis updated to mock the correct server response shape (titleas a separate top-level field, not insidetags) - Stale comment
"which include merged title"inremote_conversation.pyis removed or corrected
Additional Context
Discovered while reviewing #4814 (fixing tag pollution from LocalConversation.fork(title=...)). The ConversationInfo wire shape is a server-assembled projection of ConversationState + StoredConversation; the title lives in StoredConversation but wasn't making it back to the client because the SDK read only the tags field from ConversationInfo.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in remote_conversation.py and inspect RemoteConversation.fork() alongside ConversationInfo in models.py to compare the response fields. Update the fork construction and stale comment so the server's top-level title is preserved, then correct and run tests/sdk/conversation/remote/test_remote_fork.py::test_remote_fork_uses_server_returned_tags. Done means the test mocks title separately from tags and the returned fork reflects the server title.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100