[demo] Interview Prep: Practice Q&A auto-triggers LLM on page load, silent st.error in collapsed expander #22

Closed
opened 2026-03-17 07:01:25 -07:00 by pyr0ball · 0 comments
Owner

Bug

Surfaced by E2E smoke harness (2026-03-17).

The Practice Q&A expander in Interview Prep calls complete() on every page render when session state is empty. In demo mode this raises RuntimeError("AI inference is disabled"), rendering st.error("LLM error: …") inside the collapsed expander.

Because Streamlit collapsed expanders use display:none, the error was invisible to users but present in the DOM. The test harness detected the stAlertContentError element but reported empty text (Playwright inner_text() respects CSS visibility).

This was caught after switching the harness from inner_text() to text_content() (which reads from all elements regardless of CSS visibility).

Fix applied

  • app/pages/6_Interview_Prep.py: check DEMO_MODE before auto-triggering the LLM session. In demo mode, render st.info("AI features are disabled in the public demo…") instead.
  • tests/e2e/conftest.py: switched get_page_errors() from inner_text() to text_content() so errors inside collapsed expanders are captured with their actual message.

Commit

5d14542 — feat(e2e): add smoke + interaction tests; fix two demo mode errors

Status

Fixed and verified. Smoke test passes clean.

## Bug Surfaced by E2E smoke harness (2026-03-17). The Practice Q&A expander in Interview Prep calls `complete()` on every page render when session state is empty. In demo mode this raises `RuntimeError("AI inference is disabled")`, rendering `st.error("LLM error: …")` inside the collapsed expander. Because Streamlit collapsed expanders use `display:none`, the error was invisible to users but present in the DOM. The test harness detected the `stAlertContentError` element but reported empty text (Playwright `inner_text()` respects CSS visibility). This was caught after switching the harness from `inner_text()` to `text_content()` (which reads from all elements regardless of CSS visibility). ## Fix applied - `app/pages/6_Interview_Prep.py`: check `DEMO_MODE` before auto-triggering the LLM session. In demo mode, render `st.info("AI features are disabled in the public demo…")` instead. - `tests/e2e/conftest.py`: switched `get_page_errors()` from `inner_text()` to `text_content()` so errors inside collapsed expanders are captured with their actual message. ## Commit `5d14542` — feat(e2e): add smoke + interaction tests; fix two demo mode errors ## Status Fixed and verified. Smoke test passes clean.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Circuit-Forge/peregrine#22
No description provided.