Skip to content

Comments

fix: wire up ollama_base_url shorthand in config#175

Merged
jamiepine merged 3 commits intospacedriveapp:mainfrom
Marenz:fix/ollama-shorthand-provider
Feb 23, 2026
Merged

fix: wire up ollama_base_url shorthand in config#175
jamiepine merged 3 commits intospacedriveapp:mainfrom
Marenz:fix/ollama-shorthand-provider

Conversation

@Marenz
Copy link
Collaborator

@Marenz Marenz commented Feb 23, 2026

The `ollama_base_url` and `ollama_key` config fields were parsed but never inserted into `llm.providers`, so any config using the documented shorthand got `unknown provider: ollama` at runtime. The custom `[llm.providers.ollama]` syntax worked fine since it bypasses the shorthand entirely.

Add the missing `or_insert_with` block in both the TOML and env-var loading paths, matching the pattern used by every other provider (deepseek, minimax, etc.). Also remove the dead `normalize_ollama_base_url` function left over from the original PR.

Three unit tests added:

  • `ollama_base_url` shorthand registers the provider correctly
  • `ollama_key` alone falls back to `http://localhost:11434\`
  • explicit `[llm.providers.ollama]` takes precedence over the shorthand

Depends on #174.

Fixes #162

@Marenz Marenz force-pushed the fix/ollama-shorthand-provider branch 3 times, most recently from fa3b7fa to f382402 Compare February 23, 2026 17:14
Fix 17 clippy errors that were failing CI on main:
- Collapse nested if blocks using let-chains (stable since Rust 1.88)
- Use ? operator instead of let-else returning None (config.rs)
- Suppress too_many_arguments on TwitchAdapter::new
- Move mod tests to end of cron/scheduler.rs (items_after_test_module)

Fix bold_and_italic_nested test: add BOLD_ITALIC_PATTERN for ***text***
processed before bold/italic, producing correct <b><i>text</i></b> nesting.

Fix tests/context_dump.rs: render_channel_prompt returns Result, add
.unwrap_or_default() to match current return type.
The ollama_base_url and ollama_key config fields were parsed but never
inserted into llm.providers, so any config using the documented shorthand
got 'unknown provider: ollama' at runtime.

Add the missing or_insert_with block in both the TOML and env-var loading
paths, matching the pattern used by every other provider. Also remove the
dead normalize_ollama_base_url function that was left over from the
original PR.

Fixes spacedriveapp#162
@Marenz Marenz force-pushed the fix/ollama-shorthand-provider branch from f382402 to 43d545f Compare February 23, 2026 17:34
@keganpowers34
Copy link

@jamiepine could you look over this

@jamiepine
Copy link
Member

On it, merging a few of these fixes now and will push 0.1.15

@jamiepine jamiepine merged commit bab43a8 into spacedriveapp:main Feb 23, 2026
3 checks passed
Marenz added a commit to Marenz/spacebot that referenced this pull request Feb 23, 2026
deepseek_key was parsed and stored in LlmConfig but never inserted into
the providers HashMap, causing 'unknown provider: deepseek' errors at
runtime when deepseek appeared in a fallback chain.

Same pattern as the nvidia fix (PR spacedriveapp#82) and ollama fix (PR spacedriveapp#175).
Marenz added a commit to Marenz/spacebot that referenced this pull request Feb 23, 2026
deepseek_key was parsed and stored in LlmConfig but never inserted into
the providers HashMap, causing 'unknown provider: deepseek' errors at
runtime when deepseek appeared in a fallback chain.

Same pattern as the nvidia fix (PR spacedriveapp#82) and ollama fix (PR spacedriveapp#175).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ollama unknown provider error when trying the web GUI config

3 participants