diff options
| author | Agando <roduccomm@gmail.com> | 2026-05-29 18:01:19 +0200 |
|---|---|---|
| committer | Agando <roduccomm@gmail.com> | 2026-05-29 18:01:19 +0200 |
| commit | d570f86177c514ae888fb63fc0bb0da7dd4d5097 (patch) | |
| tree | bb7b8ebc43a967b40e23add551f676a67a5b493c /modules/core/ollama-manager.js | |
| parent | 09f14c97ba87bf16348d025d8cbbbe21cafb8097 (diff) | |
auto: 2026-05-29_18:01 changes
Diffstat (limited to 'modules/core/ollama-manager.js')
| -rw-r--r-- | modules/core/ollama-manager.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/modules/core/ollama-manager.js b/modules/core/ollama-manager.js index 3f46b13..34ece29 100644 --- a/modules/core/ollama-manager.js +++ b/modules/core/ollama-manager.js @@ -11,6 +11,12 @@ class OllamaManager { this.currentModel = localStorage.getItem('webx11_ollama_model') || 'gemma4:31b-cloud'; this.responseHooks = []; this._abortController = null; + // --- AI Agent Loop Optimization Toggle --- + this.optimizationEnabled = localStorage.getItem('webx11_optimization_enabled') !== 'false'; + // --- Validator Agent Config (future) --- + this.validatorEnabled = localStorage.getItem('webx11_validator_enabled') === 'true'; + this.validatorModel = localStorage.getItem('webx11_validator_model') || ''; + this.validatorEndpoint = localStorage.getItem('webx11_validator_endpoint') || ''; // Build fallback endpoints this.fallbackEndpoints = []; const origin = typeof window !== 'undefined' ? window.location.origin : ''; @@ -900,6 +906,25 @@ class OllamaManager { saveSettings() { localStorage.setItem('webx11_ollama_endpoint', this.endpoint); localStorage.setItem('webx11_ollama_model', this.currentModel); + localStorage.setItem('webx11_optimization_enabled', this.optimizationEnabled ? 'true' : 'false'); + localStorage.setItem('webx11_validator_enabled', this.validatorEnabled ? 'true' : 'false'); + localStorage.setItem('webx11_validator_model', this.validatorModel); + localStorage.setItem('webx11_validator_endpoint', this.validatorEndpoint || ''); + } + + setOptimizationEnabled(val) { + this.optimizationEnabled = !!val; + this.terminal?.print(`Agent optimization ${this.optimizationEnabled ? 'enabled' : 'disabled'}. Reload to apply.`, 'info'); + this.saveSettings(); + } + + setValidatorConfig(enabled, model) { + this.validatorEnabled = !!enabled; + if (model !== undefined) { + this.validatorModel = model; + localStorage.setItem('webx11_validator_model', model); + } + this.saveSettings(); } getModels() { return this.models; } |