Skip to content

Refresh AI/ML chat presets and migrate saved keys - #1145

Open
hugoaimlapi wants to merge 6 commits into
ChatGPTBox-dev:masterfrom
aimlapi:feat/aiml-model-presets
Open

hugoaimlapi wants to merge 6 commits into
ChatGPTBox-dev:masterfrom
aimlapi:feat/aiml-model-presets

Conversation

@hugoaimlapi

@hugoaimlapi hugoaimlapi commented Nov 24, 2026 •

Copy link
Copy Markdown

Follow-up to #1132 and the request to split the changes.

Changes

  • Add nine AI/ML chat presets across OpenAI, Anthropic, Google, and Moonshot. Update the gateway IDs for Claude Sonnet 4.6, Gemini 3.1 Pro, and Kimi K2.5. The gateway catalog currently lists moonshot/kimi-k3 for Chat Completions.
  • Migrate the dated Sonnet 4.6 key in saved selections and API modes. Register the AI/ML labels in the English source locale.
  • Remove the built-in provider’s legacy Completions path declaration. Existing AI/ML presets resolve to Chat Completions.

Validation

  • npm test (1,125 passed), npm run lint, npm run pretty:check, and production builds for Chromium and Firefox.
  • Verified each preset ID in the live AI/ML API model catalog under Chat Completions. A Chromium smoke test verified that the saved Sonnet selection migrates and still appears in the picker. An authenticated gateway test was attempted, but inference returned HTTP 403 on the test account.

Rollback

The migration persists the canonical Sonnet key. A build that predates this change only recognizes the dated key in saved selections.

Original implementation in #1132 by @vito-bush and Stan.


Devin Review

View guided diff

Summary by CodeRabbit

  • New Features
    • Expanded the AI/ML model catalog with new GPT, Claude, Gemini, and Kimi options, and refreshed model labels and descriptions.
    • Added a browser message for display in the interface.
  • Bug Fixes
    • AI/ML chat requests now resolve to the chat-completions endpoint instead of the completions endpoint.
    • Existing selections of the dated Claude Sonnet 4.6 model are migrated to its current model name.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T23:24:06.728595Z b2657bd PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The AI/ML model catalog and English labels now include additional models and revised identifiers. Saved Claude Sonnet keys migrate to an undated canonical key. The built-in AI/ML provider no longer configures a completions path.

Changes: AI/ML catalog and provider behavior

Layer / File(s) Summary
Update AI/ML model catalog
src/config/index.mjs, src/_locales/en/main.json, tests/unit/config/config-predicates.test.mjs
The catalog adds models and revises identifiers and descriptions. English labels are added or updated. Tests cover representative model keys and the AI/ML (...) description format.
Migrate Claude Sonnet model keys
src/config/model-key-migrations.mjs, tests/unit/config/config-predicates.test.mjs, tests/unit/config/migrate-user-config.test.mjs
Claude Sonnet aliases and the model-group override use the undated canonical key. Tests cover legacy-key recognition and migration in saved configuration.
Update AI/ML provider endpoint configuration
src/services/apis/provider-registry.mjs, tests/unit/services/apis/provider-registry.test.mjs
The built-in AI/ML provider no longer configures a completions path. The test checks provider selection and resolution of the chat-completions URL.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Possibly related PRs

  • ChatGPTBox-dev/chatGPTBox#1132: Updates the AI/ML presets, migrates dated Claude Sonnet keys, and removes the built-in provider’s completions path.

Suggested reviewers: peterdavehello

Merge Risk: Minimal · up to c55aa

This change adds AI/ML chat presets, updates several model IDs, and migrates saved dated Claude Sonnet 4.6 keys to the undated key. Tests cover the migration and the chat-completions URL resolution. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Refresh AI/ML chat presets and migrate saved keys" matches the main changes in the changeset. The diff adds AI/ML model presets in src/config/index.mjs, migrates the dated Claude Sonnet 4.6…
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.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "Refresh AI/ML chat presets and migrate saved keys" matches the main changes in the changeset. The diff adds AI/ML model presets in src/config/index.mjs, migrates the dated Claude Sonnet 4.6 key in src/config/model-key-migrations.mjs, and removes the legacy completions path in provider-registry.mjs. The title is concise, specific, and names the two primary themes (preset refresh and key migration).

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 88c164fa-4b9c-4c67-99d1-d19f3ad3f541
Commits

Reviewing files that changed from the base of the PR and between b2657bd and c55aa28.

Files selected for processing: 1

  • tests/unit/config/migrate-user-config.test.mjs
Files skipped from review as they are similar to previous changes: 1

  • tests/unit/config/migrate-user-config.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@qodo-code-review

qodo-code-review Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Refresh AI/ML chat presets and migrate saved model keys

✨ Enhancement 🐞 Bug fix 🕐 10-20 Minutes

Grey Divider

AI Description

• Add nine AI/ML chat presets and refresh gateway IDs and display labels.
• Migrate saved Claude Sonnet 4.6 selections to its canonical key.
• Remove AI/ML’s legacy Completions declaration and test chat endpoint resolution.
Merge Risk 🟡 Medium

Blast radius 🟢 Low 💥 1 capability

  • 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
  • The changed model keys, persisted configuration migration, provider identity, and chat endpoint all participate in one bounded AI/ML integration: they determine which AI/ML model is displayed, stored, and sent in the resulting chat request.
  • The provider registry and API caller are implementation hops in that same end-to-end behavior, not independent capabilities.
  • The locale changes are presentation for the same model-picker behavior.
Behavioral complexity 🟡 Medium 🧩 Compatibility cases, Straightforward

  • Before: AI/ML model keys included a dated Claude Sonnet key and existing provider-specific model values, and the provider template declared both chat and completion-path metadata.
  • After: the PR adds model-key/value pairs, replaces the dated Claude key with a canonical key, updates provider model identifiers, removes the AI/ML completion-path declaration, and adds a regression test covering migration through storage and chat request resolution.
  • For compatibility_cases, the new correctness condition is that old persisted modelName, apiMode.itemName, activeApiModes, and custom-mode entries canonicalize to the new key while retaining the AI/ML group and resolving to the intended provider model.
  • For straightforward_rule, each exposed picker key must have one matching model entry, a valid AI/ML label, and a provider-compatible value.
  • The inspected resolver behavior remains chat for AI/ML modes, so the follow-up test does not introduce a new completion/chat ordering or concurrency invariant.
Potential damage 🟡 Medium 🩹 Temporary loss

  • Conditionally, if a newly registered model value, renamed canonical key, or migration mapping is incompatible with the provider or persisted configuration, users selecting that AI/ML model may receive a failed or unavailable chat request or lose access to that selected model.
  • The affected behavior is the AI/ML integration, not unrelated providers.
  • No changed path writes external effects, and no evidence supports irreversible data loss or serious confidentiality or integrity harm.
  • Correcting or reverting the model mapping and retrying can restore behavior for configurations that still contain recognized legacy keys.
  • Configurations already rewritten to the new canonical key may require a forward migration, alias, or manual reselection; code rollback alone does not automatically repair those persisted values.
  • No automatic repair worker or external compensation mechanism is established.
Assessed commit c55aa28
Diagram

graph TD
  A[("Saved config")] --> B["Key migration"] --> C["Model presets"] --> D["Provider registry"] --> E["Chat endpoint"]
  C --> F["Model picker"]
  G["English labels"] --> F
Loading
High-Level Assessment

Use the existing preset list, legacy-key migration map, and provider registry. A separate AI/ML catalog or migration mechanism would add complexity without a clear benefit for this scoped refresh.

Files changed (7) +170 / -27

Enhancement (1) +66 / -21
index.mjsExpand and refresh AI/ML model presets +66/-21

Expand and refresh AI/ML model presets

• Adds nine selectable presets, updates the Sonnet 4.6, Gemini 3.1 Pro, and Kimi K2.5 gateway IDs, and standardizes AI/ML descriptions.

src/config/index.mjs

Bug fix (1) +4 / -3
model-key-migrations.mjsCanonicalize saved Sonnet 4.6 keys +4/-3

Canonicalize saved Sonnet 4.6 keys

• Redirects the dated Sonnet 4.6 key and older Sonnet aliases to the undated preset. Updates its API-mode group override accordingly.

src/config/model-key-migrations.mjs

Tests (3) +74 / -1
config-predicates.test.mjsCheck AI/ML preset classification and labels +12/-1

Check AI/ML preset classification and labels

• Updates representative preset keys and verifies that the dated Sonnet key still matches the AI/ML predicate after canonicalization. Checks that selectable AI/ML presets use the standardized label.

tests/unit/config/config-predicates.test.mjs

migrate-user-config.test.mjsCover migration of dated Sonnet selections +40/-0

Cover migration of dated Sonnet selections

• Tests migration of the saved model name, selected API mode, and custom API mode to the canonical Sonnet key. Confirms the migrated selection resolves to the AI/ML chat URL.

tests/unit/config/migrate-user-config.test.mjs

provider-registry.test.mjsVerify AI/ML chat-only endpoint resolution +22/-0

Verify AI/ML chat-only endpoint resolution

• Asserts that the built-in AI/ML provider has no Completions path and that a preset resolves to Chat Completions.

tests/unit/services/apis/provider-registry.test.mjs

Other (2) +26 / -2
main.jsonRegister AI/ML preset labels +26/-1

Register AI/ML preset labels

• Adds English source-locale entries for the AI/ML model descriptions, including the new presets and refreshed provider branding.

src/_locales/en/main.json

provider-registry.mjsDeclare only AI/ML Chat Completions +0/-1

Declare only AI/ML Chat Completions

• Removes the legacy Completions path from the built-in AI/ML provider declaration, leaving its Chat Completions path.

src/services/apis/provider-registry.mjs

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 7 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

View guided diff | Re-trigger cubic

@devin-ai-integration devin-ai-integration Bot left a comment

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.

🔍 Devin Review: 2 flags

Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The changes since the previous review appear safe to merge.

Summary

The PR refreshes AI/ML presets and moves saved Sonnet 4.6 selections to the current key.

  • The AI/ML picker adds nine models and refreshes several model IDs.
  • Saved Claude Sonnet 4.6 selections now use the current model key.
  • The AI/ML provider declares chat completions without a legacy completions path.

Reviews (2) · Last reviewed commit: "Shorten the AI/ML migration test name" · Reviewed by Greptile

@qodo-code-review

qodo-code-review Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. A test title runs past the line limit ✓ Resolved

Resolving commit: c55aa28

Resolution reason
The test title was shortened from 'getUserConfig moves the dated AI/ML Claude Sonnet 4.6 key to the
canonical preset' to 'getUserConfig migrates the dated AI/ML Sonnet 4.6 key', bringing the
declaration under the 100-character limit. This matches the suggested fix prompt's example almost
exactly while keeping the same test body.
Description
The new test(...) declaration at line 121 is about 103 characters wide, exceeding the
100-character source line limit. Any line-length check or 100-column guide run over this changed
test file would flag it.

Grey Divider

Context sources
✅ Linked PRs:
  🌐 PR #1132
✅ Compliance rules (platform): 6 rules
✅ Web pages:
  +2 more
Review mode: Auto: ⚖️ Balanced: Behavioral model, migration, and provider changes carry meaningful integration risk.

Grey Divider

Tip of the day
💡 Did you know, you can show, collapse, or hide each part of a finding: code, evidence, and all

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No new issues found.

Approach: sound — it fixes the data (dead/renamed gateway IDs) and carries saved selections across the key rename, rather than layering a compatibility shim over bad preset IDs.

Reviewed changes — full diff at b2657bd (7 files, 5 commits).

  • AI/ML preset refresh: aimlApiModelKeys goes from 16 to 25 entries, adding GPT-6 Astra/Luna, Claude Fable 5.1 / Opus 5.5 / Sonnet 5.5 / Haiku 5.5, Gemini 4 Argon, Gemini 3.8 Flash, and Kimi K3, plus corrected IDs for Sonnet 4.6, Gemini 3.1 Pro, and Kimi K2.5.
  • Label normalization: every AI/ML preset desc moves from AIML (…) to AI/ML (…), with the 25 labels registered in the English source locale.
  • Saved-key migration: the dated aiml_claude_sonnet_4_6_20260218 key is added to LEGACY_MODEL_KEY_MIGRATIONS and the canonical key kept in the group-override map, so modelName, apiMode, customApiModes, activeApiModes, knownApiModeDefaultIds, session history, and imported configs all canonicalize.
  • Provider declaration: the built-in aiml provider no longer declares a Completions path; a regression test pins chat-only resolution.
  • Tests: predicate/label guard, end-to-end saved-config migration, and provider endpoint coverage.

I cross-checked the load-bearing claims rather than trusting the body. All 25 preset values resolve under openai/chat-completions in the live api.aimlapi.com/v1/models catalog; the two changed existing IDs are correct canonical IDs (the previous Gemini string was an alias and the previous Kimi string does not exist), and the catalog lists no openai/completions type at all, so dropping that declaration reflects reality. I also simulated an upgrade from a stored dated-Sonnet config: the picker keeps exactly one Sonnet 4.6 row, the selection survives, and the request resolves to https://api.aimlapi.com/v1/chat/completions with the stored aiml secret. The three touched unit suites pass (202 tests), and Prettier/ESLint are clean on the changed files. Full npm test and the production builds were not re-run here; the PR reports both green.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

Copilot AI left a comment

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.

🟡 Changes recommended

The migration misses saved custom-mode keys with suffixes, causing affected entries to become unresolvable and be dropped when legacy activeApiModes are materialized and persisted.

1 open issue
What changed in this PR

Refreshes the extension’s existing AI/ML integration with updated chat presets and migration of saved Claude Sonnet 4.6 selections, following the split from #1132.

Changes:

  • Adds nine chat presets, updates gateway model IDs, and standardizes English labels to “AI/ML.”
  • Adds the canonical Sonnet 4.6 key and migration coverage for saved selections and API modes.
  • Removes the built-in provider’s legacy Completions endpoint declaration and tests Chat Completions resolution.
File Description
tests/​unit/​services/​apis/​provider-registry.test.mjs Tests AI/ML endpoint declarations and chat request resolution.
tests/​unit/​config/​migrate-user-config.test.mjs Tests persistence and routing of migrated Sonnet selections.
tests/​unit/​config/​config-predicates.test.mjs Updates model recognition cases and checks AI/ML labels.
src/​services/​apis/​provider-registry.mjs Removes the legacy Completions path.
src/​config/​model-key-migrations.mjs Maps dated Sonnet keys to the canonical preset.
src/​config/​index.mjs Expands presets and refreshes model IDs and labels.
src/​_locales/​en/​main.json Registers the AI/ML labels in the English source locale.

Review effort: Balanced

aiml_claude_3_7_sonnet_20250219: 'aiml_claude_sonnet_4_6_20260218',
aiml_anthropic_claude_sonnet_4: 'aiml_claude_sonnet_4_6',
aiml_claude_3_7_sonnet_20250219: 'aiml_claude_sonnet_4_6',
aiml_claude_sonnet_4_6_20260218: 'aiml_claude_sonnet_4_6',

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants