Skip to content

[Bug]: SMG stores non-message conversation items as JSON blobs and returns incorrect OpenAI item shape for reasoning #1363

@khoaatra

Description

@khoaatra

Bug Description

OpenAI Responses items have type-specific top-level fields such as content for message, call_id/arguments for function_call, and summary/content for reasoning.

In SMG, the response persistence path stores output items other than message as the whole item JSON inside the CONTENT column. Some item types are reconstructed back to the expected top-level shape on readback, but others are not.

This causes /v1/conversations/{id}/items to return an OpenAI-incompatible shape for reasoning items.

Steps to Reproduce

smg_test.txt
openai_test.txt

Full test steps are in 2 test files. One for openai, one for smg

Expected Behavior

Expected OpenAI-style reasoning item:


{
  "id": "rs_xxx",
  "type": "reasoning",
  "summary": []
}

Actual Behavior

Actual SMG result:

{
  "id": "rs_xxx",
  "type": "reasoning",
  "content": {
    "id": "rs_xxx",
    "type": "reasoning",
    "summary": []
  },
  "status": "completed"
}

Component

reasoning-parser

Routing Policy (if applicable)

None

Connection Mode

None

Configuration

Logs / Error Output

Environment

Cargo

Deployment Environment

Local development

Streaming Context

  • Issue occurs with streaming (SSE) responses
  • Issue occurs with non-streaming responses
  • Issue occurs in both modes

Additional Context

No response

Pre-submission Checklist

  • I have searched existing issues and discussions
  • I can reproduce this issue consistently
  • I am using the latest version of SMG

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions