Skip to content

fix(openai): preserve Responses replay through Plugin SDK calls #4033

Open

Description

@WH-2099

Problem

The OpenAI plugin already stores complete Responses output in opaque_body and reuses it for subsequent requests.
Plugin SDK 0.10.2 drops that metadata when aggregating a blocking model invocation, so a tool conversation's next request loses encrypted reasoning, output item IDs, and message phase.
The same offline round trip succeeds when streamed and fails when aggregated in blocking mode.

This affects existing Responses models independently of GPT-6 registration, which remains tracked in #3917 and #3918.

Expected behavior

Preserve complete Responses output through session.model.llm.invoke in both streaming and blocking modes.
The next request must retain encrypted reasoning, commentary phase, output item IDs, and tool call IDs before appending the tool result.
A later chunk without metadata must not erase a previously received snapshot.

Reproduction and regression coverage

Use an existing catalog model, the real OpenAI client, the real Plugin SDK Session, and HTTP mocks at the provider and host boundaries.
Return reasoning, a commentary message, and a function call in the first invocation, then inspect the second Responses request after returning the tool result.
SDK 0.10.2 loses the output snapshot in blocking mode; the immutable langgenius/dify-plugin-sdks#390 fix preserves it.

Dependencies and delivery status — 2026-11-02

langgenius/dify-plugin-sdks#390 merged on October 28.
The dependency update and integration regressions are implemented in draft #4035, which remains open and currently has conflicts with main.
Its recorded frozen-lock validation passed 319 OpenAI tests and two endpoint tests; live tests were excluded.

Publish SDK 0.11.0 through langgenius/dify-plugin-sdks#413, refresh #4035 against main, replace the review SDK Git pins, and verify the released plugin archives.
The invoking Agent must retain the complete assistant message through #4034.
The host implementation is langgenius/dify#44502, replacing closed/unmerged #41095 and covering Agent v2 and later history restoration.
langgenius/graphon#261, langgenius/graphon#355 and langgenius/graphon#376 are merged; langgenius/dify-plugin-daemon#828 and the selected production dependency/deployment still require coordination.

This issue and #4035 remain outside the Dify 1.19 milestone.
Their OpenAI/endpoint package adoption can follow its own publication schedule; source/dependency review has not established an independent host build or release dependency on those packages.
Keep this issue open for plugin delivery and acceptance, and avoid claiming the OpenAI-specific scenario fixed until those artifacts are verified.
Live vendor signature acceptance and production deployment remain unverified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions