ADFA-5132 | Prevent silent fallback to remote LLM providers - #70
Open
jatezzz wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
jatezzz
requested review from
a team,
Daniel-ADFA,
dara-abijo-adfa and
itsaky-adfa
August 18, 2026 16:15
AUTO routing and the chat's availability check both stepped past an unready backend to whichever other one happened to be configured, sending the prompt and attached source to a provider the user did not choose. Both now resolve the selected backend only and fail naming it.
jatezzz
force-pushed
the
fix/ADFA-5132-route-only-to-selected-backend
branch
from
August 18, 2026 17:13
69954c3 to
28ff896
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR prevents the AI chat from silently routing user prompts to a remote provider when the selected local backend is unconfigured.
What: Requests now strictly remain on the selected backend; if it is not ready, the system halts the request and notifies the user.
How: Modified
LlmInferenceServiceImpl.ktandChatViewModel.ktto resolve the effective backend strictly based on the stored selection, completely bypassing the fallback to other available backends. Introduced aSelectedBackendsealed interface (Installed,Missing,None) to accurately identify and report the backend's exact status.Why: Users choosing local models expect their prompts and source code to remain strictly on-device. Silent fallbacks compromise privacy by sending data to third parties without consent, while also unexpectedly consuming API quotas.
Details
Updated
strings.xmlwith clear error messages, such as explicitly stating that a specific backend is not ready and confirming that nothing was sent.The system now correctly provides distinct fixes for the user depending on whether they need to configure their chosen backend, reinstall its missing plugin, or install any backend at all.
Before
document_4907021400063084965.mp4
After
document_4907021400063084971.mp4
Ticket
ADFA-5132
Also fixes:
ADFA-5133
ADFA-5134
Observation
To prevent race conditions where a superseded availability check could overwrite a newer verdict, the check logic in
ChatViewModel.ktwas refactored. It now utilizes abackendCheckSequencenumber confined to the main thread to ensure only the most recent status is published.