Repository navigation
fix(ai): allow OpenAI-compatible providers without an API key - #1457
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Reviewed
Gaps and notes:
Files Reviewed (2 files)
Previous Review Summary (commit 6a246d1)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 6a246d1)Status: No Issues Found | Recommendation: Merge Reviewed
Gaps and notes:
Files Reviewed (2 files)
Reviewed by claude-sonnet-5.5 · Input: 252 · Output: 1.5K · Cached: 191.9K Review guidance: REVIEW.md from base branch |
1-DARK
left a comment
There was a problem hiding this comment.
Thanks for the fix, @lejyfps! I reviewed this locally at a4a5b78.
- I reproduced #1323 on the base commit: keyless model discovery returns [] without contacting the server, and generation sends an empty Authorization: Bearer header. On this branch, discovery returns the server's models and the header is left out when no key is set.
- cargo test --no-default-features --lib ai::provider_tests passes 9/9 (including your two new tests), and the wider ai filter passes 343. rustfmt and clippy are clean on the touched files, and the Tauri-boundary grep is clean.
- Other providers still require their key, and the env-var key still works.
NewtTheWolf
left a comment
There was a problem hiding this comment.
Thanks for covering both model discovery and generation while preserving authenticated requests. I reviewed a4a5b78d28a8d2d898d039356b732bc09229df72; all nine Rust provider-wire tests passed, including the local keyless discovery/generation regressions. The frontend production build and typecheck also passed.
I found no evident issue in this pass. I will verify the full settings-to-generation flow against a disposable local OpenAI-compatible server, with and without authentication, and run the full required checks before merging.
|
Tested Exercised cached/fresh model discovery without a key, generated and ran a count query through AI Query Assist, and opened its AI explanation. Captured requests omitted Authorization. An auth-required fixture rejected the missing key; saving a test key through Settings restored model discovery/generation with the correct Bearer header. An unconfigured OpenAI provider still rejected the request before contacting a provider. |
Resolves the conflicts with API Route (TabularisDB#1459) and the inline completion and optional-key changes (TabularisDB#1455, TabularisDB#1457). Both providers are kept in every list, with Opper after Requesty and API Route after Opper. In ai.rs the Opper model fetch stays as step 7, followed by main's new custom-openai discovery and the API Route catalog. Inline completion goes through dispatch_provider, so it reaches Opper without further changes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Fixes #1323.
OpenAI-compatible endpoints such as local llama.cpp servers can now load their model catalog and generate responses without configuring an API key. Configured keys are still sent as Bearer tokens; requests without a key omit the Authorization header. Other providers retain their existing key requirements.
Both cached and fresh model discovery accept a missing key. The shared provider dispatcher supports keyless generation, explanation and naming requests in desktop and web.
Validation:
Manual verification: select OpenAI Compatible in AI settings, enter a local server URL, leave the key unset, refresh models, select a default model and generate a query. Repeat against an endpoint requiring a configured key.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.