Skip to content

feat(providers): support inline quirks in preset definitions - #944

Open
mcowger wants to merge 4 commits into
mainfrom
docs/provider-definitions-plan
Open

mcowger wants to merge 4 commits into
mainfrom
docs/provider-definitions-plan

Conversation

@mcowger

@mcowger mcowger commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Overview

Provider presets can now describe compatibility behavior for services that are not in the pi-ai catalog, without borrowing another provider's identity. Selecting a preset can carry those settings into a provider, while presets without compatibility settings still work as ordinary endpoint shortcuts.

✨ New Features

  • Inline compatibility settings: Presets can specify reasoning levels, output-token limits, and request-field differences by API and model. Auto Compat remains opt-in.
  • Neuralwatt preset: Replaces the borrowed OpenRouter mapping with documented Chat, Messages, and Responses endpoints and explicit Chat/Responses behavior.

🐛 Bug Fixes

  • Cleared the unverified-endpoint warnings for documented DeepSeek Responses, MiniMax Messages (Global and China), and Vercel Messages and Responses routes. DeepSeek's stateless Responses limitation remains visible in its setup note.

🔧 Improvements

  • The Add Provider form distinguishes built-in pi-ai mappings, inline quirks, and no compatibility source. Saved provider settings and model-list metadata retain the chosen behavior.
  • Published a JSON Schema for preset authors, added catalog/schema checks in CI, and documented the new provider settings. An in-repo skill guides contributors through endpoint research and each relevant compatibility quirk.

Testing

  • Exercised preset selection, switching back to Custom, and provider save/readback in a local browser.
  • Checked request projection without pi-ai model IDs, including model-specific overrides, and validated the published preset schema and local catalog.

Notes

  • The branch contains generated SQLite and Postgres migration artifacts for the new provider field. Migration generation on main is the normal repository workflow; these files were generated locally, not hand-edited.

Add a published editor schema, persist explicit compatibility traits, and include generated SQLite and Postgres migrations.
Drops borrowed openrouter piAiProvider; documents chat/messages/responses
on https://api.neuralwatt.com/v1 with inline reasoning quirks and
autoCompat, backed by official docs and endpoint probes.
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🔍 OpenCodeReview found 2 issue(s) in this PR.

  • ✅ Successfully posted inline: 2 comment(s)

Comment on lines 1423 to +1424
pi_ai_provider: raw || undefined,
pi_ai_quirks: raw ? undefined : editingProvider.pi_ai_quirks,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
Inline quirks can be lost for good. Nothing in the UI shows or edits them; the only sign they exist is the "inline quirks active" label. In this custom text input, typing a single character sets pi_ai_quirks to undefined. Deleting the text afterwards doesn't bring them back, because editingProvider.pi_ai_quirks is already gone. The <select> handler above has the same problem. On save, saveProvider sends pi_ai_quirks: null, and the PATCH route then deletes the stored quirks. For an existing provider, a stray keystroke or dropdown click wipes the quirks with no way to recover them in the UI. Suggested fix: keep the original quirks in a ref and restore them when the provider field is cleared, or ask for confirmation before replacing them. Pull this logic into one helper shared by both handlers so they don't drift apart.

Comment on lines +302 to +307
{selectedPreset.piAiProvider ? (
<>
Uses the pi-ai <code className="text-primary">{selectedPreset.piAiProvider}</code>{' '}
catalog; auto-compat requires a matching model ID.
</>
) : selectedPreset.piAiQuirks ? (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style · medium
This is a nested ternary (piAiProvider ? … : piAiQuirks ? … : …), which the checklist doesn't allow. Move it into a renderCompatSummary(preset) helper that uses if/else returns.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 OpenCodeReview — detailed findings

✅ Passing — no critical/high findings.

Reviewed 35 file(s), 2 finding(s) total.

  • medium — packages/frontend/src/components/providers/ProviderAdvancedEditor.tsx:1423-1424: Inline quirks can be lost for good. Nothing in the UI shows or edits them; the only sign they exist is the "inline quirks active" label. In this custom text input, typing a single character sets pi_ai_quirks to undefined. Deleting the text afterwards doesn't bring them back, because editingProvider.pi_ai_quirks is already gone. The <select> handler above has the same problem. On save, saveProvider sends pi_ai_quirks: null, and the PATCH route then deletes the stored quirks. For an existing provider, a stray keystroke or dropdown click wipes the quirks with no way to recover them in the UI. Suggested fix: keep the original quirks in a ref and restore them when the provider field is cleared, or ask for confirmation before replacing them. Pull this logic into one helper shared by both handlers so they don't drift apart.
  • medium — packages/frontend/src/components/providers/ProviderPresetPicker.tsx:302-307: This is a nested ternary (piAiProvider ? … : piAiQuirks ? … : …), which the checklist doesn't allow. Move it into a renderCompatSummary(preset) helper that uses if/else returns.

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