Add visible inference-engine selection indicator to Gradio app
Session from read-along-ai-agent-traces on Hugging Face by kingkw1 · MIT · condensed by Coders Talk
11msession
1interventions
GOAL
Add a clear visual indicator showing whether the app is using Modal or local inference, then fix related engine-default and first-load prewarm bugs.
- +0Prompt · +0The app doesn't show which inference engine (Modal or local) is selected. Add an indicator, fitting the theme.
- +0mAgent did · +0mExplored app.py's engine-selection state, added a separate 'active engine' status badge/HTML element wired to button clicks, added a regression test, and verified with pytest (29 passed).
- +4mIntervention · +4mDeveloper rejected the badge approach and asked for the mode button itself to change color instead.Why: I didn't like adding a whole new object to the UI just to show state — the buttons themselves should carry the selected look.
- +4mAgent did · +4mRemoved the badge entirely and reworked the click handlers/CSS so the selected engine button itself gets a distinct color (green for Turbo, orange for Local) while the inactive button fades; updated tests and reran pytest (29 passed).
- +10mPrompt · +10mNow fix two issues: default back to Off the Grid (local) mode, and fix first-sentence word-help voices always showing fallback 'browser word help ready'.
- +11mFail · +11mFound the bug: ensure_current_level_prewarm received the selected engine but didn't pass it into start_word_voice_prewarm, so the first sentence always prewarmed with the Modal default and fell back to browser word help.
- +11mAgent did · +11mIntroduced DEFAULT_INFERENCE_ENGINE = LOCAL_ENGINE as single source of truth, used it for initial radio value and button styling, fixed the prewarm call to forward the selected engine, added tests, and reran pytest.
- +11mOutcome · +11mDelivered: color-coded engine buttons replace the badge, local mode restored as default, first-load word-help prewarm bug fixed; 30 tests passing.
VERDICT
Next time I'd just ask for the mode buttons themselves to change color from the start, since that's the solution I actually wanted — the badge approach was wasted work. The correction that mattered was rejecting the badge and asking for button-color state instead; the agent's own diagnosis of the prewarm engine-forwarding bug was solid and fixed cleanly on the first try.