Skip to content

Responses streaming function-call conversion loses namespace required for replay #7910

Open

Description

@mip1983

Description

We observed a completed namespaced Responses function call losing its namespace during streaming conversion/replay. The subsequent provider request can then be rejected because the function does not exist in the default namespace.

Versions

  • Microsoft.Extensions.AI.OpenAI: 10.10.1
  • Microsoft.Extensions.AI.Abstractions: 10.10.0
  • OpenAI: 2.14.0
  • Azure.AI.Extensions.OpenAI: 3.0.0-beta.6

Observed behaviour

  1. Hosted tool search makes a namespaced function available.
  2. The provider returns a completed function-call item with namespace, call_id, name and arguments.
  3. The streaming adapter's StreamingResponseOutputItemDoneUpdate conversion constructs FunctionCallContent using the call ID, function name and parsed arguments, without retaining the completed native item on that content.
  4. Subsequent Responses input retains the call ID, name and arguments but omits the namespace.

We verified the returned namespace and its absence from subsequent input by inspecting the actual response/request bodies. The provider rejected the replay with the following message (function name omitted):

Missing namespace for function_call … It does not exist in the default namespace. Round-trip the model's function_call item with its namespace field included.

Expected behaviour

Input-relevant function-call metadata, particularly namespace, should survive streaming conversion and subsequent replay. Is there an existing supported way to retain this metadata that we should use?

This is distinct from merely preserving the function-call/result pair: those pairs were intact.

Current mitigation and verification

At the model middleware boundary, we attach the completed native function-call item from ChatResponseUpdate.RawRepresentation to its matching typed FunctionCallContent. We retain typed/executable calls and also preserve that native representation across JSON-backed history.

A deterministic regression verifies the namespace survives storage and serialized compaction projection while call/result identity remains intact. A subsequent live run completed successfully, with raw-wire assertions checking function-call IDs, names, namespaces and parsed arguments in the next provider input.

We do not expect output-only response metadata such as status or response ID to be replayed. This report concerns the namespace required to interpret the call correctly.

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

    area-aiMicrosoft.Extensions.AI librariesuntriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions