Commit 40156b6
committed
fix: resolve URL loading timeout issues in @ mentions
## Problem
URLs provided through @ mentions were failing to load with "Navigation timeout of 10000 ms exceeded" errors, preventing users from fetching web content for AI assistance.
## Solution
- **Increased timeout limits**: Extended UrlContentFetcher timeout from 10s to 30s and BrowserSession timeout from 7s to 15s for better reliability with slow-loading websites
- **Added fallback retry logic**: If networkidle2 fails, automatically retry with domcontentloaded only (20s timeout) to handle JavaScript-heavy sites
- **Improved error handling**: Enhanced error messages with specific guidance for timeout, DNS, network, and HTTP status errors
- **Enhanced browser compatibility**: Added Chrome launch arguments (--no-sandbox, --disable-web-security, etc.) and set proper viewport/headers to reduce blocking by websites
## Files Changed
- `src/services/browser/UrlContentFetcher.ts`: Increased timeout, added retry logic, enhanced browser setup
- `src/services/browser/BrowserSession.ts`: Increased navigation timeouts for consistency
- `src/core/mentions/index.ts`: Improved error handling with user-friendly messages
## Impact
Users can now successfully fetch content from slower websites and receive clearer error messages when issues occur, significantly improving the @ mention URL feature reliability.
Fixes #14301 parent 992997c commit 40156b6
File tree
3 files changed
+54
-6
lines changed- src
- core/mentions
- services/browser
3 files changed
+54
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
103 | 119 | | |
104 | 120 | | |
105 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
| 323 | + | |
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| |||
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
406 | | - | |
| 406 | + | |
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
479 | | - | |
| 479 | + | |
480 | 480 | | |
481 | 481 | | |
482 | 482 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
51 | 60 | | |
52 | 61 | | |
53 | 62 | | |
54 | 63 | | |
55 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
56 | 73 | | |
57 | 74 | | |
58 | 75 | | |
| |||
71 | 88 | | |
72 | 89 | | |
73 | 90 | | |
74 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
75 | 107 | | |
76 | 108 | | |
77 | 109 | | |
| |||
0 commit comments