fix(api): enhance model availability probing with backoff and caching mechanisms (#2231)

* fix(api): enhance model availability probing with backoff and caching mechanisms

* fix(lint): resolve gci and predeclared issues in model probe

* fix(api): address copilot review feedback on probe cache key and test stability

* fix(api): reduce probe cache key fragmentation
This commit is contained in:
LC authored and GitHub committed 2026-04-01 14:15:28 +08:00
1 parent 0f395ce110
commit f327859cce
3 files changed
+612 -8

No files matched your search

+4
View File
@@ -20,10 +20,14 @@ func resetModelProbeHooks(t *testing.T) {
origTCPProbe := probeTCPServiceFunc
origOllamaProbe := probeOllamaModelFunc
origOpenAIProbe := probeOpenAICompatibleModelFunc
origNow := modelProbeNowFunc
resetModelProbeCache()
t.Cleanup(func() {
probeTCPServiceFunc = origTCPProbe
probeOllamaModelFunc = origOllamaProbe
probeOpenAICompatibleModelFunc = origOpenAIProbe
modelProbeNowFunc = origNow
resetModelProbeCache()
})
}