Skip to content

feat: add native OpenAI Responses API pass-through#267

Open
shulin16 wants to merge 1 commit into
ericc-ch:masterfrom
shulin16:feat/native-responses-api
Open

feat: add native OpenAI Responses API pass-through#267
shulin16 wants to merge 1 commit into
ericc-ch:masterfrom
shulin16:feat/native-responses-api

Conversation

@shulin16

Copy link
Copy Markdown

Summary

  • add native POST /responses and POST /v1/responses endpoints
  • forward the original request text and upstream response body without JSON or SSE reserialization
  • preserve structured and streaming upstream errors, retry metadata, and request cancellation
  • detect nested vision input, classify agent-initiated input, and document the new endpoints
  • add focused coverage for request forwarding, streaming, errors, headers, CORS, vision, and initiator behavior

Why this approach

This overlaps in endpoint scope with #219 and #230, but deliberately uses a raw pass-through instead of parsing and rebuilding Responses API output. That preserves typed SSE event lines and forward-compatible payload fields, and avoids the async-generator serialization issue reported on #230.

It also adds behavior not covered by those proposals: forwarding request text without JSON reserialization, propagating the inbound AbortSignal, stripping stale compression/length headers after fetch decoding, preserving non-2xx JSON and SSE bodies, and exposing retry/request headers through CORS.

#263 solves a different problem by adapting Responses-only models back into Chat Completions shape; this PR exposes the native OpenAI Responses API shape unchanged.

Validation

  • bun test — 61 passing
  • bun run typecheck
  • bun run lint
  • bun run build

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c9c89bc0-58cc-4dc8-89a0-83e012ff8c4f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant