webpeel 0.21.23 → 0.21.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -844,20 +844,27 @@ export class DuckDuckGoProvider {
844
844
  // Stage 4: Stealth multi-engine (DDG + Bing + Ecosia in parallel)
845
845
  // Bypasses bot-detection on datacenter IPs. This is the reliable
846
846
  // last resort — but it spins up a browser so it takes a few seconds.
847
+ // DISABLED on memory-constrained servers (512MB) — Playwright OOM kills.
848
+ // Set NO_BROWSER_SEARCH=1 to skip this stage entirely.
847
849
  // -----------------------------------------------------------
848
- log.debug('Trying stealth browser search (DDG + Bing + Ecosia)...');
849
- try {
850
- const stealthProvider = new StealthSearchProvider();
851
- // StealthSearchProvider already applies filterRelevantResults internally.
852
- const stealthResults = await stealthProvider.searchWeb(query, options);
853
- if (stealthResults.length > 0) {
854
- log.debug(`source=stealth returned ${stealthResults.length} results`);
855
- return stealthResults;
850
+ if (!process.env.NO_BROWSER_SEARCH) {
851
+ log.debug('Trying stealth browser search (DDG + Bing + Ecosia)...');
852
+ try {
853
+ const stealthProvider = new StealthSearchProvider();
854
+ // StealthSearchProvider already applies filterRelevantResults internally.
855
+ const stealthResults = await stealthProvider.searchWeb(query, options);
856
+ if (stealthResults.length > 0) {
857
+ log.debug(`source=stealth returned ${stealthResults.length} results`);
858
+ return stealthResults;
859
+ }
860
+ log.debug('Stealth search returned 0 results');
861
+ }
862
+ catch (e) {
863
+ log.debug('Stealth search failed:', e instanceof Error ? e.message : e);
856
864
  }
857
- log.debug('Stealth search returned 0 results');
858
865
  }
859
- catch (e) {
860
- log.debug('Stealth search failed:', e instanceof Error ? e.message : e);
866
+ else {
867
+ log.debug('Stealth browser search skipped (NO_BROWSER_SEARCH=1)');
861
868
  }
862
869
  return [];
863
870
  }
@@ -341,6 +341,10 @@ export function createFetchRouter(authStore) {
341
341
  lite: lite === 'true',
342
342
  timeout: timeout ? parseInt(timeout, 10) : undefined,
343
343
  captionImages: captionImages === 'true',
344
+ // Prevent auto-escalation to browser unless render=true is explicitly requested.
345
+ // On 512MB containers, surprise browser launches cause OOM kills.
346
+ // Domain extractors (GitHub, Wikipedia, npm etc.) use HTTP APIs, not the browser.
347
+ noEscalate: !shouldRender,
344
348
  };
345
349
  // Auto-budget: default to 4000 tokens for API requests when no budget specified
346
350
  // Opt-out: budget=0 explicitly disables. Lite mode disables auto-budget.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpeel",
3
- "version": "0.21.23",
3
+ "version": "0.21.24",
4
4
  "description": "Fast web fetcher for AI agents - stealth mode, crawl mode, page actions, structured extraction, PDF parsing, smart escalation from simple HTTP to headless browser",
5
5
  "author": "Jake Liu",
6
6
  "license": "AGPL-3.0-only",