← Back to PRs

#23745: fix(resilience): add timeout to unguarded fetch calls in browser subsystem

by kevinWangSheng open 2026-02-22 17:05 View on GitHub →
cli size: XS
## Summary - Problem: Several `fetch()` calls in the browser subsystem and CLI lack timeout/AbortSignal, risking indefinite hangs if remote endpoints are unresponsive - Why it matters: A hanging fetch blocks the event loop caller, which can stall browser tool operations, camera capture, and extension relay authentication - What changed: Added `AbortSignal.timeout(10_000)` to two unguarded fetch calls in `nodes-camera.ts` and `pw-session.ts` - What did NOT change: Existing fetch calls in `chrome.ts` and `extension-relay-auth.ts` already use `AbortController` with timeouts and were left untouched ## Change Type - [x] Bug fix ## Scope - [x] Skills / tool execution - [x] UI / DX ## Security Impact - New permissions/capabilities? No - Secrets/tokens handling changed? No - New/changed network calls? No (existing calls get timeout added) - Command/tool execution surface changed? No - Data access scope changed? No ## Test plan - [x] `npx vitest run src/browser/` — 40 test files, 261 tests passed - [x] `npx vitest run src/cli/nodes-camera` — 1 test file, 15 tests passed 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- greptile_comment --> <h3>Greptile Summary</h3> Added 10-second timeouts to two previously unguarded `fetch()` calls in `pw-session.ts:417` and `nodes-camera.ts:81` using `AbortSignal.timeout(10_000)`, preventing indefinite hangs if remote endpoints become unresponsive. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The changes are minimal, focused, and improve resilience by adding timeout protection to two unguarded fetch calls. The timeout value of 10 seconds is appropriate for these network operations. Tests pass, and the implementation follows best practices. - No files require special attention <sub>Last reviewed commit: 476ef7a</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs