Skip to content

Python: [Bug]: hosting-responses rejects input messages that omit "type" #9123

Closed

Description

Description

messages_from_responses_input in agent_framework_hosting_responses/_parsing.py only treats an input item as a message when it has "type": "message". In the OpenAI Responses API type is optional on message items (EasyInputMessage), and the OpenAI SDK sends the common shorthand without it:

client.responses.create(model=..., input=[
    {"role": "developer", "content": "Talk like a pirate."},
    {"role": "user", "content": "Are semicolons optional?"},
])

The hosting app rejects that request with HTTP 400:

from agent_framework_hosting_responses._parsing import messages_from_responses_input

messages_from_responses_input([
    {"role": "developer", "content": "Talk like a pirate."},
    {"role": "user", "content": "Are semicolons optional?"},
])
# ValueError: Unsupported Responses input content type: None

With "type": "message" added to each item it works.

Expected

An item with a role and no type is parsed as a message, the same as "type": "message".

Package Versions

agent-framework-hosting-responses on main (279d97f)

Python Version

3.12

Activity

  1. added
    pythonUsage: [Issues, PRs], Target: Python
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Oct 6, 2026
  2. added
    reproducedUsage: [Issues], Target: all issues that can be reproduced by the triage workflow
    on Oct 6, 2026
  3. github-actions commented on Oct 6, 2026

    @github-actions
    Contributor

    🤖 Automated triage reproduction notes (agent-authored — trust but verify)

    Agent analysis

    python/packages/hosting-responses/agent_framework_hosting_responses/_parsing.py::messages_from_responses_input at lines 150-175 rejects list items containing role and content when type is omitted, ultimately raising at line 125. Minimal repro: call the function with [{"role": "developer", "content": "Talk like a pirate."}, {"role": "user", "content": "Are semicolons optional?"}].

    • Failing test: python/packages/hosting-responses/tests/hosting_responses/test_parsing.py::TestMessagesFromResponsesInput::test_message_without_type_with_string_content
    • Files examined: python/packages/hosting-responses/agent_framework_hosting_responses/_parsing.py, python/packages/hosting-responses/tests/hosting_responses/test_parsing.py, python/packages/hosting-responses/tests/hosting_responses/test_http_round_trip.py, python/packages/hosting-responses/pyproject.toml
    • Tests run: test_message_without_type_with_string_content (failed), test_message_envelope_with_string_content (passed)
    • Reported version: main (279d97f7)
    • Current version: 1.0.0a261002
  4. added
    hostingUsage: [Issues, PRs], Target: all hosting related solutions
    and removed
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

hostingUsage: [Issues, PRs], Target: all hosting related solutionspythonUsage: [Issues, PRs], Target: PythonreproducedUsage: [Issues], Target: all issues that can be reproduced by the triage workflow

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions