Skip to content

fix(api): add type field to messages in Responses API#5701

Open
Patel230 wants to merge 5 commits intoKilo-Org:mainfrom
Patel230:fix/responses-api-type-field
Open

fix(api): add type field to messages in Responses API#5701
Patel230 wants to merge 5 commits intoKilo-Org:mainfrom
Patel230:fix/responses-api-type-field

Conversation

@Patel230
Copy link

@Patel230 Patel230 commented Feb 6, 2026

Summary

OpenAI's Responses API requires the field to be explicitly set in message objects when using array input. Some OpenAI-compatible endpoint providers fail with HTTP 500 errors when is missing.

Changes

  • Add to user and assistant messages in
  • Add to user message in

Before

After

Fixes

Fixes #5700

OpenAI's Responses API requires the type field to be explicitly set in message
objects when using array input. Some OpenAI-compatible endpoint providers fail
with HTTP 500 errors when type is missing.

Changes:
- Add type: "message" to user and assistant messages in formatFullConversation
- Add type: "message" to user message in completePrompt

Fixes Kilo-Org#5700
@changeset-bot
Copy link

changeset-bot bot commented Feb 6, 2026

🦋 Changeset detected

Latest commit: be1da59

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Fix the same issue found in:
- openai-codex.ts (Codex provider)
- openai-native.ts (OpenAI Native provider)

All three Responses API handlers now include type: "message" for user and assistant messages.

Related: Kilo-Org#5700
The original interface supported:
- Regular messages with role (now also includes type: "message")
- Other items like function_call/output without role

My previous change was too restrictive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Responses API missing type field in array input causes compatibility issues

1 participant