Skip to content

fix(desktop): restore sleep/wake session recovery + repair 3 stale renderer tests#148

Merged
OmarB97 merged 3 commits into
mainfrom
fix/desktop-renderer-test-regressions
Jun 10, 2026
Merged

fix(desktop): restore sleep/wake session recovery + repair 3 stale renderer tests#148
OmarB97 merged 3 commits into
mainfrom
fix/desktop-renderer-test-regressions

Conversation

@OmarB97

@OmarB97 OmarB97 commented Jun 10, 2026

Copy link
Copy Markdown
Owner

What

Repairs all 4 failing desktop renderer unit tests. One is a real shipped regression; three are stale tests that drifted from the components they cover.

The regression (real bug)

submitPromptText's sleep/wake recovery — resume the durable stored session and retry once when prompt.submit returns "session not found" — was added in 72f522d4 but silently dropped by the session-presence merge (9ac0530) while its test survived. Result: after the laptop sleeps/wakes and the gateway's in-memory session table is cleared, the next message fails with "session not found" instead of transparently recovering.

Restored the resume-once logic, preserving the Phase 2b sender_device params on both submit attempts.

The 3 stale tests

These broke when components legitimately evolved. They went unnoticed because CI doesn't run the vitest UI suite — no workflow invokes test:ui.

Test Why it broke Fix
model-settings The same commit that added the /set up/ assertion also removed the " - set up" dropdown suffix (the inline setup flow replaced it) Drop the stale assertion — the unconfigured provider appearing at all is the full-universe signal; inline activation is covered by the next test
toolset-config-panel The inline "Set" button became a 3-dot EnvVarActionsMenu Drive the save through the menu; stub the pointer-capture / scrollIntoView APIs Radix needs under jsdom
streaming (reasoning card) Reasoning auto-opens while running and streams through SmoothStreamingText Drop the old "click to expand" (it collapsed the already-open disclosure) and pump the rAF reveal before asserting

Verification

  • vitest run --environment jsdom: 485 passed (was 4 failed | 481 passed)
  • tsc --noEmit: clean
  • eslint src/: 0 errors

Follow-up

The root cause of the silent rot is that CI doesn't gate on the vitest UI suite. Wiring test:ui into CI (with the non-vitest node-pty/electron/scripts paths excluded from collection) would catch this class of regression — tracking separately.

…3 stale renderer tests

The sleep/wake session resume+retry path in submitPromptText (added in
72f522d) was silently dropped by the session-presence merge (9ac0530)
while its test survived. After sleep/wake the gateway's in-memory session
table is cleared, so the first prompt.submit returns "session not found"
and now surfaces as an error instead of transparently resuming the durable
stored session and retrying. Restore the resume-once logic, preserving the
Phase 2b sender_device params on both submit attempts.

The other three were stale tests that broke when the components legitimately
evolved — invisible because CI does not run the vitest UI suite:

- model-settings: the same commit that added the "/set up/" assertion also
  removed the " - set up" dropdown suffix in favor of the inline setup flow.
  Drop the stale assertion; the unconfigured provider appearing at all is the
  full-universe signal (inline activation is covered by the next test).
- toolset-config-panel: the inline "Set" button became a 3-dot actions menu
  (EnvVarActionsMenu). Drive the save through the menu, and stub the
  pointer-capture / scrollIntoView APIs Radix needs under jsdom.
- streaming (reasoning code card): reasoning auto-opens while running and
  streams through SmoothStreamingText, so the old "click to expand" collapsed
  it and the rAF reveal had not drained. Drop the click and pump the reveal.

All 485 renderer tests pass; tsc and eslint clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

🔎 Lint report: fix/desktop-renderer-test-regressions vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 10688 on HEAD, 10688 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 5598 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

OmarB97 pushed a commit that referenced this pull request Jun 10, 2026
A unit test could reach a real 'pip install': with the elevenlabs SDK
absent, any agent init whose tool checks touch a lazy feature walks
check_tts_requirements -> ensure("tts.elevenlabs") ->
_venv_pip_install (allow_lazy_installs fails open by design). Under
tests/run_agent/test_create_openai_client_proxy_env.py the install
tunnels through the test's fake proxy env vars and hangs to the suite
timeout — the intermittent test (3) failures on #148/#155.

Set HERMES_DISABLE_LAZY_INSTALLS=1 in _hermetic_environment, next to
the equivalent TIRITH_ENABLED guard: ensure() now raises
FeatureUnavailable immediately and the TTS check degrades to False
deterministically. tests/tools/test_lazy_deps.py already overrides the
var in both directions per test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@OmarB97 OmarB97 merged commit 258332e into main Jun 10, 2026
25 checks passed
OmarB97 added a commit that referenced this pull request Jun 10, 2026
…te renderer tests in CI (#160)

The running-turn timer's per-session clock (upstream NousResearch#41182) was clipped by the
upstream-sync's internal merge (e866446): ClientSessionState.turnStartedAt
and its tests survived, but all six seed/clear sites in use-message-stream.ts
and the view-sync mirror in use-session-state-cache.ts vanished — so the
statusbar timer never starts, and a backgrounded turn's elapsed time zeroes on
focus (the exact bug NousResearch#41182 fixed). Restored all seven sites to upstream's
shape. Renderer suite: 602/602 (first fully-green run; also passes under
TZ=UTC).

Because nothing in CI ran this suite, the clobber merged silently — same class
as the sleep/wake-recovery loss (#148). Add renderer-tests.yml gating
`vitest run --environment jsdom src` on every PR so the next one can't.

Co-authored-by: Omar Baradei <omar@kostudios.io>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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