Skip to content

fix(new-api): separate responses endpoint option#1812

Merged
yyhhyyyyyy merged 1 commit into
devfrom
fix/newapi-selectable-responses
Jun 25, 2026
Merged

fix(new-api): separate responses endpoint option#1812
yyhhyyyyyy merged 1 commit into
devfrom
fix/newapi-selectable-responses

Conversation

@yyhhyyyyyy

@yyhhyyyyyy yyhhyyyyyy commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Keep supportedEndpointTypes as upstream-declared metadata and expose synthetic openai-response choices through selectableEndpointTypes.

Summary by CodeRabbit

  • New Features
    • Added support for more flexible endpoint selection for compatible models, including an additional selectable response option where available.
    • Model settings now surface eligible endpoint choices more accurately in the configuration dialog.
  • Bug Fixes
    • Improved handling of special model types so speech, transcription, and other non-chat models are no longer shown with inappropriate endpoint options.
    • Preserved the currently selected endpoint when opening model configuration.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a787dbc9-cf1a-404f-af34-186bb2d5d7d5

📥 Commits

Reviewing files that changed from the base of the PR and between 3d10913 and 3373bbe.

📒 Files selected for processing (9)
  • src/main/presenter/llmProviderPresenter/providers/aiSdkProvider.ts
  • src/renderer/settings/components/ProviderModelList.vue
  • src/renderer/src/components/settings/ModelConfigDialog.vue
  • src/renderer/src/stores/modelStore.ts
  • src/shared/contracts/common.ts
  • src/shared/types/presenters/core.presenter.d.ts
  • src/shared/types/presenters/llmprovider.presenter.d.ts
  • test/main/presenter/llmProviderPresenter/newApiProvider.test.ts
  • test/renderer/components/ModelConfigDialog.test.ts

📝 Walkthrough

Walkthrough

The PR adds optional selectableEndpointTypes metadata for New API models, computes OpenAI-response eligibility during provider parsing, and propagates the field through renderer normalization and model configuration selection.

Changes

Selectable endpoint type flow

Layer / File(s) Summary
Shared metadata fields
src/shared/contracts/common.ts, src/shared/types/presenters/core.presenter.d.ts, src/shared/types/presenters/llmprovider.presenter.d.ts
Shared schemas and presenter types add optional selectableEndpointTypes alongside supportedEndpointTypes.
New API routing
src/main/presenter/llmProviderPresenter/providers/aiSdkProvider.ts, test/main/presenter/llmProviderPresenter/newApiProvider.test.ts
New API parsing preserves raw supported endpoint types, maps video-generation, computes eligible openai-response options for OpenAI chat models, and adds tests for the routing cases.
Renderer propagation
src/renderer/src/stores/modelStore.ts, src/renderer/settings/components/ProviderModelList.vue
Renderer normalization, stored/runtime model mapping, and virtual model items carry selectableEndpointTypes through to RENDERER_MODEL_META.
Endpoint option precedence
src/renderer/src/components/settings/ModelConfigDialog.vue, test/renderer/components/ModelConfigDialog.test.ts
availableEndpointTypes prefers selectableEndpointTypes when present and falls back to supportedEndpointTypes; the new unit test covers this path.

Sequence Diagram(s)

sequenceDiagram
  participant aiSdkProvider
  participant modelStore
  participant ModelConfigDialog
  aiSdkProvider-->>modelStore: MODEL_META with selectableEndpointTypes
  modelStore-->>ModelConfigDialog: RENDERER_MODEL_META with selectableEndpointTypes
  ModelConfigDialog->>ModelConfigDialog: prefer selectableEndpointTypes for availableEndpointTypes
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • ThinkInAIXYZ/deepchat#1443: Adds the earlier NewAPI provider plumbing and endpointType routing that this PR extends with selectableEndpointTypes and OpenAI-response selection.

Suggested reviewers

  • zerob13

Poem

A bunny hopped through model rows,
With endpoint choices in its nose.
openai-response peeked out, bright and new,
While cozy defaults stayed snug too.
🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: separating the OpenAI responses endpoint into a distinct selectable option for new-api models.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/newapi-selectable-responses

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@yyhhyyyyyy yyhhyyyyyy merged commit ee575e7 into dev Jun 25, 2026
3 checks passed
@zhangmo8 zhangmo8 deleted the fix/newapi-selectable-responses branch June 25, 2026 01:44
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