SillyTavern / SillyTavern

LLM Frontend for Power Users.
https://sillytavern.app
GNU Affero General Public License v3.0
12.81k stars 3k forks source link

[BUG] 20 seconds are spent attempting to connect to (?) when selecting Connection Profile for different custom URL #3683

Closed cloak1505 closed 1 week ago

cloak1505 commented 1 week ago

Environment

🪟 Windows

System

Firefox

Version

1.12.12 'staging' (ea989df6a)

Desktop Information

No response

Describe the problem

Use case: I have a connection profile that is just API (custom) and Server URL (custom URL). I expect to be able to select this profile and have the saved URL show up in the Custom URL field instead of waiting a long time for the URL to appear.

What / when it happens: If the current chat completion preset or connection profile does not have a custom URL (preset's custom_url), then I stare at an empty Custom URL field for 10 20 seconds (rolled back to check), resulting in the console message "Could not connect after 10 seconds, skipping." twice 10 s apart before the URL finally appears.

Note: The custom URL can be even made up for fast switching. It doesn't care about invalid URLs as long as it isn't blank. For example, <None> in profile dropdown has blank which will induce the wait when switching back to the profile. (seems unrelated on re-investigation)

Additional info

The delay occurs regardless of whether target URL is connectable. This shows it is messing with the blank first before switching to the target the user actually wants to connect to.

If I were to come from a non-blank, the green dot with "Status check bypassed" will show for a non-connectable URL (Test Message still works on the one I was testing, namely https://api.cohere.ai/compatibility/v1 but this isn't the issue), otherwise "Valid" for a connectable URL.

Please tick the boxes

cloak1505 commented 1 week ago

Issue persists. Now even the workaround of bogus URL leads to the delay, including when target profile's URL is valid. Tested on Chrome as well.

Anyone else able to reproduce?

Just in case: Image (The first one is emitted once upon selection.)

Wait time is 20 seconds, including for blank, and same as previous.

cloak1505 commented 1 week ago

It's fast now. 👍

Actual junk gets the new status "Invalid endpoint URL. Requests may fail." which makes sense.