Skip to content

Bug: Python SDK Gradient streaming drops delta.reasoning_content #2006

Backlog

Description

@basil-k-aji-dev

Component

OpenLIT Python SDK (sdk/python, DigitalOcean Gradient instrumentation)

What happened?

Streamed Gradient chat completions drop delta.reasoning_content. process_chunk in instrumentation/gradient/utils.py has no branch for it, and scope._reasoning_text is only filled from the Responses API reasoning_text.delta events. The output-message builder already renders scope._reasoning_text as a reasoning part, so for streamed chat on a reasoning model it is always empty.

The sibling instrumentation/pydo/utils.py handles the same chat-completions delta (delta.get("reasoning_content") appended to scope._reasoning_text).

Steps to reproduce

Feed gradient.utils.process_chunk a streamed chunk with choices[0].delta.reasoning_content = "step one". scope._reasoning_text stays empty.

Expected behavior

The reasoning text accumulated and emitted as a reasoning part, as in pydo.

Environment

main at the time of filing.

Additional context

Separate from the cache-token gap; I can send both fixes as two small PRs.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions