Skip to content

refactor(ai): make OpenAI Responses extend the Open Responses baseline #38537

Closed

Description

@opencode-agent

Problem

The current generic Responses adapter layers on top of the OpenAI-specific Responses protocol:

  • OpenAICompatibleResponses.route.protocol reuses OpenAIResponses.protocol
  • the baseline contract therefore inherits OpenAI-specific request fields, events, options, and behavior

That dependency points in the wrong direction for a provider-neutral Open Responses protocol. The baseline should define the shared contract, while OpenAI Responses should extend it with OpenAI-specific capabilities.

Desired direction

  • Define a provider-neutral Open Responses protocol as the baseline.
  • Have OpenAI Responses extend or compose that baseline with OpenAI-only fields and behavior.
  • Keep shared lowering and stream parsing in the baseline where the protocol guarantees it.
  • Keep OpenAI-specific options, hosted tools, event variants, and transport behavior in the OpenAI layer.
  • Revisit public names while making this split so the generic protocol and OpenAI-compatible provider adapter are not conflated.

Done when

  • The protocol dependency points from OpenAI Responses to the generic Open Responses baseline, not the reverse.
  • Generic providers can use the baseline without inheriting OpenAI-only behavior.
  • Existing OpenAI Responses HTTP/WebSocket behavior remains covered by tests.
  • The package exports and naming clearly distinguish the protocol contract from provider compatibility/configuration helpers.

Source discussion: team Slack thread

Activity

  1. opencode-agent commented on Jul 24, 2026

    @opencode-agent
    ContributorAuthor

    Addressed by #38681. The AI package now defines a provider-neutral Open Responses baseline, composes OpenAI Responses on top for OpenAI-specific hosted tools, options, event aliases, WebSocket transport, and defaults, and moves compatible/Vertex routes onto the neutral protocol. Existing provider and Core resolution coverage passed. Closing as resolved on the v2 branch.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions