[codex] Extract local AI provider controls#454
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR extracts the Local AI/Ollama connection checks, PII probing, model advisor rendering, and hardware-override handlers from
Confidence Score: 5/5Safe to merge — this is a pure code extraction with no logic changes to any non-local-AI path, and backward compatibility is maintained via re-exports in provider-panels.js. The extraction is mechanically faithful: every exported symbol is re-exposed, the dependency-injection pattern for returnToChatIfOnboarding is correct, and the new URL-validation and no-cors CORS probe are improvements over the old code. The only behavioral delta (loss of CORS guidance in the outer catch block) is a narrow edge case and does not affect data integrity or security. js/provider-local-ai-controls.js — both connection-test catch blocks lost the CORS-specific error message that was present in the old code. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[testOllamaConnection / testPIIOllamaConnection] --> B[normalizeLocalAiBaseUrl]
B -->|error| C[Show validation error, return]
B -->|ok url| D{isHttpsToNonLocalhost?}
D -->|yes| E[Show HTTPS/localhost error, return]
D -->|no| F[HEAD preflight fetch]
F -->|success| G[checkOpenAICompatible + checkOllama]
F -->|transport error| H[isFetchTransportError?]
H -->|yes| I[isLikelyCorsBlocked no-cors probe]
H -->|no| G
I -->|reachable| J[Show CORS help text, return]
I -->|unreachable| G
G -->|result.available + models| K[Update UI, saveOllamaConfig, renderModelAdvisor]
G -->|not available| L[throw Not reachable]
G -->|exception| M[Show NOT_CONNECTED_TEXT]
K --> N[updatePrivacyStatusCard / returnToChatIfOnboarding]
Reviews (3): Last reviewed commit: "Refine local AI CORS detection" | Re-trigger Greptile |
Summary
provider-local-ai-controls.js.provider-panels.jsas the settings bridge for existing exports and window-facing handlers.APP_VERSIONto1.8.280.Validation
node tests/test-hardware.jsnode tests/test-audit.jsnode tests/test-pii.jsnode tests/test-openrouter.jsnode tests/test-custom-api.jsnode tests/test-cashu-wallet.js./run-tests.sh