feat(THU-615): require successful connection test before saving a model#1006
Open
raivieiraadriano92 wants to merge 2 commits into
Open
Conversation
Semgrep Security ScanNo security issues found. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ae0f71b. Configure here.
|
Preview environment deployed 🚀
Stack: Auto-destroys on PR close/merge. Login via the bundled Keycloak realm — |
PR Metrics
Updated Thu, 18 Jun 2026 21:52:36 GMT · run #1958 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Extracts the model-connection-test logic from the Add Model dialog into a reusable
useModelConnectionTesthook and wires it into the Edit Model flow, so users editing an existing model (e.g. updating its API key or URL) can verify the credentials before saving — same Test Model button, success/error cards, and 10s timeout as the add path. Any edit to the model id, URL, or API key invalidates a prior successful test.Fixes THU-615.
Note
Medium Risk
Changes when models can be persisted and sends credentials through a live API probe; misconfigured or flaky tests could block legitimate saves, though behavior matches the prior add flow.
Overview
Add and edit model flows now require a successful connection test before Add Model or Save is enabled. Connection testing is extracted into reusable
useModelConnectionTest(10s timeout, samegenerateTextprobe as before) instead of living in the page reducer.The edit model dialog gains the same Test Model UI and status cards as add. Save stays disabled until the form is dirty and the latest test succeeded. Changing model id, URL, or API key resets test state; in-flight tests use a run id so stale results cannot mark success after credentials change.
Add-dialog reducer drops connection-test actions/state;
canTestModelConnectioncentralizes when the test button shows.Reviewed by Cursor Bugbot for commit 3028a9a. Bugbot is set up for automated code reviews on this repo. Configure here.