diff --git a/packages/stage-ui/src/stores/modules/consciousness.ts b/packages/stage-ui/src/stores/modules/consciousness.ts index d88dd1bbb..7bb6d2bca 100644 --- a/packages/stage-ui/src/stores/modules/consciousness.ts +++ b/packages/stage-ui/src/stores/modules/consciousness.ts @@ -1,6 +1,6 @@ import { useLocalStorage } from '@vueuse/core' import { defineStore } from 'pinia' -import { computed, ref, watch } from 'vue' +import { computed, ref } from 'vue' import { useProvidersStore } from '../providers' @@ -65,33 +65,6 @@ export const useConsciousnessStore = defineStore('consciousness', () => { return [] } - let player2Interval: ReturnType | undefined - // Watch for provider changes and load models - watch(activeProvider, async (newProvider) => { - await loadModelsForProvider(newProvider) - resetModelSelection() - - if (newProvider === 'player2') { - // Ping heal check every 60 seconds if Player2 is being used - player2Interval = setInterval(() => { - // eslint-disable-next-line no-console - console.log('Sending Player2 Health check if it is being used') - fetch(`localhost:4315/v1/health`, { - method: 'GET', - headers: { - 'player2-game-key': 'airi', - }, - }) - .catch(() => { }) - }, 60_000) - } - else { - if (player2Interval) - clearInterval(player2Interval) - player2Interval = undefined - } - }) - const configured = computed(() => { return !!activeProvider.value && !!activeModel.value }) diff --git a/packages/stage-ui/src/stores/providers.ts b/packages/stage-ui/src/stores/providers.ts index d9633273c..f78d85821 100644 --- a/packages/stage-ui/src/stores/providers.ts +++ b/packages/stage-ui/src/stores/providers.ts @@ -1427,8 +1427,16 @@ export const useProvidersStore = defineStore('providers', () => { ], }, validators: { - validateProviderConfig: (config) => { - return !!config.baseUrl + validateProviderConfig: async (config) => { + // Check if the Ollama server is reachable + return !!config.baseUrl && await fetch(`localhost:4315/v1/health`, { + method: 'GET', + headers: { + 'player2-game-key': 'airi', + }, + }) + .then(response => response.ok) + .catch(() => false) }, }, },