fix: reliability batch 2B — language guard recalibration (effective language, honest bypass, span-aware technical) - #83
Merged
Conversation
Batch 1 changed set_active_model to return ModelSwitchOutcome { reason }.
The Playwright mock still returned the pre-batch unit (null) shape, so
modelStore.selectModel's result.data.reason access threw during first-run
onboarding, stalling the model->shortcut step. Update the mock to the real
shape and null-guard the frontend read defensively.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3 tasks
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.
Before Submitting This PR
Human Written Description
This is the last piece of the language-correctness work: making the paste-time language guard trustworthy. It had three problems that all pushed the same direction — it judged output against the raw language you'd locked rather than the one the model could actually honor. So locking a language your model doesn't support would divert a perfectly correct transcription to the clipboard, translation that never happened could still wave text through, and a single URL in a sentence could make the whole thing skip the check. This fixes all three and consumes the structured language outcome the earlier batches built.
What's in the batch
Support::Unsupported), the guard no longer blocks the resulting correct output.translation_performed == true), not merely that the model supports translation or it was requested.Testing
tsc, ESLint, Prettier, translations, settings-lock coverage, cargo-deny: pass. No new deps/lockfile/user-facing strings.unsupported_locked_language_falls_back_to_auto_without_guard_blockfail; restoring passes.aron canary-180m (supports en/de/es/fr only) + real English audio → guard does not block; English transcription flows (the fixed behavior).aron whisper-small (does support ar) + real English audio → guard does block. The guard still protects when the lock is genuinely supported.AI Assistance
If AI was used:
🤖 Generated with Claude Code