Skip to content

fix(openrouter): show preset field when editing connections - #3921

Merged
diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.26from
rdself:coder/openrouter-edit-preset-ui
Jun 15, 2026
Merged

diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.26from
rdself:coder/openrouter-edit-preset-ui

Conversation

@rdself

@rdself rdself commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Pass the provider page id into EditConnectionModal so provider-specific edit controls still render when the selected connection row does not include provider metadata.
  • Render the OpenRouter preset field at the same top-level settings tier as the Claude Code compatible 1M context toggle instead of inside Advanced Settings.
  • Update the OpenRouter preset UI placeholder to @preset/slug.
  • Add regression tests for Add/Edit OpenRouter preset rendering outside Advanced Settings.

Validation

  • npx vitest run --config vitest.config.ts connModals
  • npm run check:file-size
  • npm run typecheck:core
  • npx eslint src/app/(dashboard)/dashboard/providers/[id]/components/modals/AddApiKeyModal.tsx src/app/(dashboard)/dashboard/providers/[id]/components/modals/EditConnectionModal.tsx src/app/(dashboard)/dashboard/providers/[id]/components/modals/tests/connModals.test.tsx
  • git diff --check
  • Dev server smoke attempted against DATA_DIR=/Users/roger/Downloads/omni; in-app browser blocked localhost/127.0.0.1 with ERR_BLOCKED_BY_CLIENT, while the jsdom component regressions cover the missing Edit UI state directly.

@rdself
rdself requested a review from diegosouzapw as a code owner June 15, 2026 20:19
Copilot AI review requested due to automatic review settings June 15, 2026 20:19

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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR updates EditConnectionModal to support cases where the provider is derived from the page context (via a new providerId prop), and adds test coverage to ensure OpenRouter preset UI renders correctly in that scenario.

Changes:

  • Add optional providerId to EditConnectionModal and use it as a fallback when connection.provider is missing.
  • Refactor provider-based branching to use a single derived provider variable and simplify provider-specific string field extraction via a helper.
  • Add a test to assert OpenRouter preset rendering when the provider comes from the page.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
src/app/(dashboard)/dashboard/providers/[id]/components/modals/tests/connModals.test.tsx Adds coverage for OpenRouter preset when provider is supplied via page context; minor formatting cleanup.
src/app/(dashboard)/dashboard/providers/[id]/components/modals/EditConnectionModal.tsx Introduces providerId fallback and refactors provider-dependent logic accordingly.
src/app/(dashboard)/dashboard/providers/[id]/components/ProviderModalsPanel.tsx Passes providerId through to EditConnectionModal and tightens selectedConnection typing.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request refactors the EditConnectionModal to accept a providerId prop, allowing it to resolve the provider even when the connection is null. It also introduces a stringField helper to clean up form data initialization and adds a unit test for rendering OpenRouter presets. The reviewer feedback recommends moving the definition of isCompatible to the top of the component with other provider-derived flags to improve readability and prevent potential lexical scope issues, while removing its duplicate definition later in the file.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks, @rdself! 🙏 Nice follow-up to #3878 — the preset field not showing when editing an OpenRouter connection (because it keyed off connection.provider, missing in some paths) is exactly the kind of gap that makes a feature feel broken. Threading providerId through ProviderModalsPanel and deriving provider = connection?.provider || providerId, plus moving the input out of Advanced into a visible block, fixes both. vitest green (16 files / 187 tests, incl. the new conn-modals cases). Merging into release/v3.8.26. 🚀

@diegosouzapw
diegosouzapw merged commit e9671d0 into cheaper-inference:release/v3.8.26 Jun 15, 2026
2 checks passed
diegosouzapw pushed a commit that referenced this pull request Jun 15, 2026
Integrated into release/v3.8.26 (reconciled cc-defaults UI with #3921)
@diegosouzapw diegosouzapw mentioned this pull request Jun 16, 2026
@rdself
rdself deleted the coder/openrouter-edit-preset-ui branch June 24, 2026 03:25
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
…3879)

Integrated into release/v3.8.26 (reconciled cc-defaults UI with cheaper-inference#3921)
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.

3 participants