Skip to content

fix(mobile): prevent fallback tool timeout cascades - #712

Open
cha1latte wants to merge 1 commit into
codedogQBY:mainfrom
cha1latte:agent/upstream-fix-mobile-fallback-timeouts
Open

fix(mobile): prevent fallback tool timeout cascades#712
cha1latte wants to merge 1 commit into
codedogQBY:mainfrom
cha1latte:agent/upstream-fix-mobile-fallback-timeouts

Conversation

@cha1latte

Copy link
Copy Markdown
Contributor

Summary

  • keep the mobile original-file extractor alive at app root in a minimally visible 1x1 WebView
  • coalesce concurrent same-book fallback extraction requests
  • stop cascading fallback content calls for a turn after the source becomes unavailable
  • add regression coverage for host ownership, provider behavior, request coalescing/retry, and the turn-level circuit breaker

Root cause

Android can freeze the extractor WebView when it is mounted at 0x0. Concurrent fallback calls then start duplicate extraction waits, and each one independently times out.

Verification

  • TZ=UTC pnpm --filter @readany/core test — 588/588 passed
  • pnpm --filter @readany/app-expo test — 20/20 passed
  • pnpm --filter @readany/app-expo exec tsc --noEmit — passed
  • Biome check on all 12 changed files — passed with existing noExplicitAny warnings only
  • live Android proof in the downstream Shlai build: fallback search 1.415s, TOC 5ms, chapter context 4ms, with no timeout errors

@cha1latte
cha1latte marked this pull request as ready for review August 22, 2026 20:14
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