Skip to content

Conversation

@ferenci84
Copy link
Contributor

@ferenci84 ferenci84 commented Sep 22, 2025

Description

OpenAI Responses API integration to enable GPT‑5 features

This PR adds first-class support for the OpenAI Responses API (streaming and non‑streaming) and routes supported models (o‑series, GPT‑5) through it. The Responses API is required to fully use GPT‑5 features like native reasoning, structured output items, and robust tool calling.

What changed

  • Responses API request/response handling for both streaming and non‑streaming flows
  • Support for reasoning items and structured outputs; tool calls with proper argument streaming
  • Persisted provider metadata to correctly pair reasoning and output items across turns
  • Type‑safe request bodies and simplified event handling
  • Kept Chat Completions for legacy/non‑supported models (backward compatible)

Impact

  • Unlocks GPT‑5 capabilities end‑to‑end in Continue
  • More reliable tool calling and reasoning visibility
  • Minimal UI/state updates to surface new metadata and avoid duplicate output

No breaking changes for existing non‑o‑series models.

Please note that the changes was made on top of other PR changes #7073 as it contained changes required by this feature.

Related issues:
#5730
#7618

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-general-review or @continue-detailed-review

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screen recording or screenshot

[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]

Tests

[ What tests were added or updated to ensure the changes work as expected? ]


Summary by cubic

Integrates the OpenAI Responses API to unlock GPT‑5 and o‑series features (reasoning, structured outputs, stronger tool calls) while keeping Chat Completions for legacy models. Improves streaming, logging, and UI/state to surface reasoning and tool metadata reliably.

  • New Features

    • Add OpenAI Responses API support (streaming and non‑streaming) and route GPT‑5/o‑series models through it.
    • Preserve and emit reasoning content and reasoning_details; handle Claude signatures safely; store per‑message metadata.
    • Improve tool calling with function call items and argument streaming; pair tool outputs via stable output item IDs.
    • Type‑safe conversions: map Responses input/output to internal messages (toResponsesInput/fromResponsesChunk) including thinking blocks.
    • Provider capability flags for reasoning fields; enabled for Deepseek and OpenRouter.
    • Backward compatible: non‑supported models still use Chat Completions.
  • Refactors

    • Faster streaming: accumulate chunks in arrays and join once; unified chunk processing and usage tracking.
    • Better logging, including optional citation messages at the end of streams.
    • Clearer error handling across providers (404/401 and missing /v1 guidance).
    • UI/state updates: action visibility tweaks in StepContainer; merge reasoning_details across chunks and track responsesOutputItemId in session state.

ferenci84 added 18 commits July 29, 2025 08:33
… on responses_api_2 to bring in Responses API work and merged updates
@ferenci84 ferenci84 requested a review from a team as a code owner September 22, 2025 09:48
@ferenci84 ferenci84 requested review from RomneyDa and removed request for a team September 22, 2025 09:48
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Sep 22, 2025
@ferenci84 ferenci84 changed the title OpenAI Responses API integration to enable GPT-5 features feat: Integrate OpenAI Responses API to enable GPT-5 features Sep 22, 2025
@RomneyDa
Copy link
Collaborator

@sestinj bumping this for gpt 5 codex!

@RomneyDa
Copy link
Collaborator

RomneyDa commented Oct 9, 2025

@ferenci84 just double checking, this PR includes everything from #7073? Seems like besides the merge commits I pushed to #7073 it's the same, could I just close that one and merge this one or am I missing some nuance there?

@Patrick-Erichsen
Copy link
Collaborator

Patrick-Erichsen commented Oct 18, 2025

llm-index-merge-resolution.patch

@ferenci84 mind taking a look at this patch to handle the merge conflict? If it's good let's apply it, once we get the conflict resolved I think this is good to merge 👍

- Resolved conflict in core/llm/index.ts
- Integrated lastRequestId tracking with refactored Responses API methods
- Added request ID tracking to openAIAdapterStream and openAIAdapterNonStream methods
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 23, 2025
@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Oct 23, 2025
@sestinj sestinj merged commit 5eb9f4a into continuedev:main Oct 23, 2025
77 of 85 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Oct 23, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Oct 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants