forked from cline/cline
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Labels
Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.Someone is actively working on this. Should link to a PR soon.enhancementNew feature or requestNew feature or request
Description
Type
Enhancement
Problem / Value
Adding Responses API support alongside Chat Completions in a single handler becomes hard to maintain. The two APIs differ significantly (params, streaming formats, response handling). Merging both into openai.ts would create complexity and long-term maintenance risk.
Context
- Responses API introduces many specialized streaming events (30+)
- openai-native.ts already has ~1000 lines of dedicated Responses logic
- A combined approach in OpenAI Compatible would quickly become tangled
Proposal
Introduce clear separation with a small shared core:
- A base class with shared OpenAI logic (auth, retry, metrics, basic transforms)
- Separate handlers for:
- Chat Completions
- Responses API (specialized streaming/response parsing)
- Auto-detect via URL pattern and route to the correct handler
This mirrors the successful pattern in openai-native.ts and keeps both paths maintainable as OpenAI evolves the Responses API or phases out Chat Completions.
Acceptance Criteria
- OpenAI-compatible provider routes requests based on URL pattern to either Chat Completions or Responses handlers
- Responses API handler supports its streaming/event model without leaking complexity into the Chat handler
- Shared base avoids duplication (auth, request wiring, error normalization)
- Clear, testable boundaries; adding new Responses events doesn’t impact Chat handler
Notes
- Use openai-native.ts as a reference design for Responses API support
- Keep file structure explicit (e.g., openai-responses.ts) or refactor with a base + two concrete classes
- I’m happy to help with the implementation if this direction is approved
Metadata
Metadata
Assignees
Labels
Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.Someone is actively working on this. Should link to a PR soon.enhancementNew feature or requestNew feature or request
Type
Projects
Status
Issue [In Progress]