fix(stage-ui): flashing and unreadable validator (#2302)

## Description

Fix the flashing validator on the provider setting page which is unable
to read and interface. Now it is stable to show the status of the
provider and help users to do the further config.

## Linked Issues

#2301 


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved credential validation stability by preventing repeated
validation for equivalent credential values.
* Preserved debounced validation behavior and manual test state resets.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
AdairLi
2026-08-17 11:24:20 +08:00
committed by GitHub
parent 73c05d37eb
commit c4778686ff
@@ -241,12 +241,18 @@ export function useProviderValidation(providerId: string) {
}
})
watch(credentials, () => {
// The synced config store re-applies fresh object snapshots (new references,
// identical content) after every synced action. Watching a serialized signature
// instead of the deep object prevents equivalent snapshots from re-triggering
// validation, which would otherwise loop with markProviderAdded().
const credentialsSignature = computed(() => JSON.stringify(credentials.value))
watch(credentialsSignature, () => {
debouncedValidateConfiguration()
// Reset manual test state when credentials change
// Reset manual test state when credentials actually change
manualTestPassed.value = false
manualTestMessage.value = ''
}, { deep: true })
})
function handleResetSettings() {
const defaultOptions = providerMetadata.value?.defaultConfig ?? {}