Skip to content

fix: refine AI model connection testing - #1369

Merged
wsp1911 merged 1 commit into
GCWing:mainfrom
wsp1911:main
Jul 1, 2026
Merged

fix: refine AI model connection testing#1369
wsp1911 merged 1 commit into
GCWing:mainfrom
wsp1911:main

Conversation

@wsp1911

@wsp1911 wsp1911 commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Limit AI configuration connection checks to a dedicated 5-attempt retry budget while keeping normal AI streaming requests at 10 attempts.
  • Expand transport error details and surface localized TLS/certificate, proxy, and network troubleshooting guidance in model connection test results.
  • Add API URL validation so model provider URLs must start with http:// or https://.
  • Avoid retesting every model after provider saves; only auto-test models affected by connection or request-behavior changes.

Fixes #

Type and Areas

Type:

bug fix / UI/UX

Areas:

AI adapters, web UI, i18n

Motivation / Impact

Connection tests were slow and unclear in SSL/proxy failure cases, often ending with a generic error sending request for url message. This makes connection tests faster, shows more actionable diagnostics, and avoids unnecessary API calls when editing provider model lists.

Users also get immediate validation when the API URL is missing a required HTTP(S) scheme.

Verification

  • pnpm run fmt:rs passed
  • cargo check -p bitfun-ai-adapters passed
  • pnpm run type-check:web passed
  • pnpm run i18n:audit passed

Reviewer Notes

  • Normal AI streaming retry behavior remains unchanged at 10 attempts.
  • The reduced 5-attempt budget only applies to model connection checks.
  • Automatic post-save testing now scopes to changed/new models unless provider-level connection settings changed, in which case the saved provider group is tested.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

Use a dedicated 5-attempt retry budget for AI connection tests while
leaving normal streaming requests at the existing 10-attempt budget.
Expand transport error details so TLS/certificate, proxy, and network
failures can surface localized troubleshooting guidance instead of only
showing a generic request send failure.

Validate model API URLs before saving so they must start with http:// or
https://. Also narrow automatic post-save connection tests to new or
request-affecting model changes, and only retest an entire provider group
when provider-level connection settings changed.
@wsp1911
wsp1911 marked this pull request as ready for review July 1, 2026 03:06
@wsp1911
wsp1911 merged commit 3141168 into GCWing:main Jul 1, 2026
4 checks passed
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