Skip to content

[Bug]: RemoteConversation.fork() ignores title in server response; test mocks wrong server shape #4847

Description

@BSmick6

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() reads title from the server response and surfaces it on the returned fork object
  • test_remote_fork_uses_server_returned_tags is updated to mock the correct server response shape (title as a separate top-level field, not inside tags)
  • Stale comment "which include merged title" in remote_conversation.py is 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:mediumFor bugs, a serious source of annoyance, but not blocking a large number of users.ready-for-devIssue meets development readiness criteriarelease-note-requiredPR requires explicit release-note coverage for behavioral or default changessdk

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions