Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions app/assets/js/main-legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -26853,10 +26853,11 @@ ${info.features.map((f) => ` • ${f}`).join("\n")}
return;
}
} else {
// Standard provider - check API key
// Standard provider - check API key (local Ollama/LM Studio need none)
const localCompat = ['local-openai', 'ollama', 'lmstudio', 'vllm'].includes(provider);
const hasApiKey = selectedOption?.dataset.apiKey && selectedOption.dataset.apiKey.length > 0;

if (!hasApiKey) {
if (!hasApiKey && !localCompat) {
showToast('No API key configured for this provider. Please add in Settings.', 'error');
Logger.error('[AI] No API key for provider:', provider);
return;
Expand Down Expand Up @@ -27650,7 +27651,8 @@ ${info.features.map((f) => ` • ${f}`).join("\n")}
// Store full API config as data attribute
option.dataset.apiUrl = api.apiUrl;
option.dataset.model = api.model;
option.dataset.apiKey = api.apiKey;
option.dataset.apiKey = api.apiKey || (localCompat ? 'ollama' : '');
option.dataset.apiKeyOptional = localCompat ? 'true' : 'false';

if (hasApiKey) {
hasUsableProvider = true;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ async function saveCurrentPreferences() {

// Only update if field has value, otherwise keep existing (skip redaction markers)
const existingKey = (existing?.apiKey && !existing.apiKey.startsWith('[REDACTED:')) ? existing.apiKey : '';
const apiKey = apiKeyField || existingKey || '';
const apiKey = apiKeyField || existingKey || (provider.apiKeyOptional ? 'ollama' : '');
const apiUrl = apiUrlField || existing?.apiUrl || provider.defaultUrl;

return {
Expand Down
2 changes: 1 addition & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
<script type="module" src="assets/js/settings.js"></script>

<!-- Legacy app code (temporary - will be modularized) -->
<script src="assets/js/main-legacy.js?v=debug_force_v1" defer></script>
<script src="assets/js/main-legacy.js?v=local-openai-nokey" defer></script>

</head>

Expand Down
Loading