Skip to content

ADFA-5132 | Prevent silent fallback to remote LLM providers - #70

Open
jatezzz wants to merge 1 commit into
mainfrom
fix/ADFA-5132-route-only-to-selected-backend
Open

ADFA-5132 | Prevent silent fallback to remote LLM providers#70
jatezzz wants to merge 1 commit into
mainfrom
fix/ADFA-5132-route-only-to-selected-backend

Conversation

@jatezzz

@jatezzz jatezzz commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

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.kt and ChatViewModel.kt to resolve the effective backend strictly based on the stored selection, completely bypassing the fallback to other available backends. Introduced a SelectedBackend sealed 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.xml with 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.kt was refactored. It now utilizes a backendCheckSequence number confined to the main thread to ensure only the most recent status is published.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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
jatezzz force-pushed the fix/ADFA-5132-route-only-to-selected-backend branch from 69954c3 to 28ff896 Compare August 18, 2026 17:13
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.

1 participant