Skip to content

Python: [Bug] ChatKit input tags are dropped from user messages #8096

Closed

Description

@VedanthB

Description

ThreadItemConverter.user_message_to_input currently handles UserMessageTextContent but ignores UserMessageTagContent, even though ChatKit user messages accept input tags and the converter exposes tag_to_message_content for converting them.

As a result, tags disappear from mixed text/tag messages, and a tag-only user turn is discarded entirely. The expected behavior is for tags to be converted through tag_to_message_content and kept in their original position relative to adjacent text.

I’m preparing a narrow fix with regression tests.

Code Sample

item = UserMessageItem(
    id="msg_tag",
    thread_id="thread_1",
    created_at=datetime.now(),
    type="user_message",
    content=[
        UserMessageTextContent(text="Ask "),
        UserMessageTagContent(
            type="input_tag",
            id="tag_1",
            text="john",
            data={"name": "John Doe"},
            interactive=False,
        ),
        UserMessageTextContent(text=" about the report."),
    ],
    attachments=[],
    inference_options=InferenceOptions(),
)

messages = await ThreadItemConverter().to_agent_input(item)

Current result: Ask about the report.

Expected result with the default tag converter: Ask <TAG>Name:John Doe</TAG> about the report.

Package Versions

  • agent-framework-chatkit==1.0.0b260730
  • openai-chatkit==1.6.5

Python Version

Python 3.14.3

Additional Context

I searched the current issues and pull requests for ChatKit input_tag, UserMessageTagContent, and input-tag conversion and did not find an existing report or competing fix.

Activity

  1. added
    python
    triage
    on Sep 6, 2026
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

    pythontriage

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions