Skip to content

[UAL-PR-04] OpenAI streaming approval parity #1320

@zhaowenzi

Description

@zhaowenzi

Parent: #1316
Track: Slice A — OpenAI reference implementation

Goal

OpenAI streaming approval interrupt and approval continuation reach full parity with OpenAI's observed contract.

Acceptance Criteria

  • Approval-required MCP calls in streaming mode emit, in order:
    1. response.output_item.added with mcp_approval_request
    2. response.output_item.done with the same item
    3. response.completed
    4. [DONE]
  • Pending approval is never flattened into a placeholder mcp_call.
  • previous_response_id + mcp_approval_response + stream=true is accepted as a 200 SSE response; approved continuation resumes the expected mcp_call.
  • Approved continuation reuses the same max_tool_calls budget and malformed-argument tool-error behavior as the non-streaming path; no adapter-local 500s.
  • Tests:
    • Streaming continuation-specific budget and malformed-argument coverage.
    • End-to-end local flow: interrupt → previous_response_id + mcp_approval_response → resumed mcp_call → final response.completed.
    • Manual parity check against real OpenAI for the streaming approval interrupt sequence.

Dependencies

Out of Scope

  • Generalized approval continuation across all routers (PR9).
  • Router-common approval abstraction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmcpMCP related changesmodel-gatewayModel gateway crate changesopenaiOpenAI router changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions