Skip to content

Gemini: lowest thinking per model family, clearer failures, cancel an… - #33

Merged
smnexstudio merged 1 commit into
mainfrom
fix/gemini-models-errors-cancel
Nov 23, 2026
Merged

smnexstudio merged 1 commit into
mainfrom
fix/gemini-models-errors-cancel

Conversation

@smnexstudio

Copy link
Copy Markdown
Owner

What this changes

Gemini calls now ask for the least thinking each model allows, failures say what actually went wrong, and a failing model can be swapped for another without spending extra quota.

  • Thinking: each Gemini request starts at the lowest thinking setting the model's family accepts (2.5: budget 0, Pro 128; 3 Flash and Flash-Lite: MINIMAL; Pro, 3.7+ and Gemini 4: LOW). The step-down ladder gains LOW and budget-128 rungs. temperature is no longer sent to Gemini 4 and 3.6+. Saved request profiles move to a new key (<model>|v2) so models the old ladder left on default thinking are re-learned once.
  • Failures: EngineFailure.Network carries a kind (unreachable, timeout, TLS); 408 maps to a timeout. A Gemini 403 that is not about the key (verification, billing) shows Google's reason instead of "add key";
  • Models: the key sheet's dropdown puts a curated list first, filtered by the key's own models.list, with no generation requests.
  • Cancel and model change: Settings › Try a translation has a Cancel button and a 45 s cap on cloud engines; saving a new model or key stops a running try. In the Reader, a model changed in Settings stops the running translation and leaves Start ready, and the bar shows the engine's model.

Why: some Gemini models failed with "network error", some were overloaded, and a Try that hung could not be stopped.

How it was checked

Unit tests (JVM): :core:engine, :feature:settings and :feature:browser pass. New tests cover the family rules, the model advice and health record, 403/408/timeout mapping, the failure rule, and the Try box. Provider calls go to MockWebServer.

Device: Motorola Edge 60 Pro, debug build, Gemini with the author's own key.

  • gemini-flash-latest, gemini-flash-lite-latest, gemini-3.5-flash-lite and gemini-3.5-flash accepted MINIMAL on the first request, with no refused retry. gemini-3.7-flash accepted LOW.
  • Reader on a Japanese manga page (JA → EN): 9 bubbles in one request, Gemini 3.9 s, whole screen 10.4 s. Reader on Pepper&Carrot (EN → ES): 6 images in one request, Gemini 4.7 s, whole screen 7.5 s.
  • gemini-3.8-flash returned quota errors on the free tier (20 requests a day); that is the key's limit, not a defect here.

@github-actions

Copy link
Copy Markdown

✅ Unit tests: PASS

898 of 898 passed · line coverage 59.3% (logic 68.1%, Compose UI 45.9%) · branch coverage 43.9%

Full HTML report (expected vs actual for every test) · Workflow run

Module Tests Passed Failed Skipped Lines Logic UI Branches
app 21 21 0 0 13.7% 5.1% 19.9% 14.3%
core/data 100 100 0 0 85.9% 85.9% – 63.4%
core/engine 169 169 0 0 79.1% 79.1% – 65.6%
core/model 73 73 0 0 92.2% 92.2% – 48.2%
core/ocr 45 45 0 0 45.8% 45.8% – 41.4%
core/pipeline 27 27 0 0 69.5% 69.5% – 47.3%
core/render 62 62 0 0 85.9% 85.9% – 67.8%
core/ui 18 18 0 0 41.7% 64.4% 39.1% 38.1%
feature/browser 67 67 0 0 19.2% 26.8% 0.0% 18.6%
feature/library 16 16 0 0 89.4% 100.0% 88.2% 68.2%
feature/settings 59 59 0 0 83.0% 77.3% 84.8% 55.9%
feature/studio 241 241 0 0 50.6% 68.0% 35.9% 36.6%

JVM unit tests (testDebugUnitTest, :core:model:test). Instrumented tests need a device and are not run in CI. Compose UI = files declaring @Composable functions; the rest, view models included, is logic.
Commit a91de35.

@smnexstudio
smnexstudio merged commit 398451b into main Nov 23, 2026
2 checks passed
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