@askjo/camofox-browser 1.7.3 → 1.7.4

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.
package/lib/reporter.js CHANGED
@@ -789,7 +789,13 @@ export function createReporter(config) {
789
789
 
790
790
  const enabled = config.crashReportEnabled !== false && !!_GH_APP_ID;
791
791
  const repo = config.crashReportRepo || cr.repo || 'jo-inc/camofox-browser';
792
- const rateLimiter = new RateLimiter(config.crashReportRateLimit || 10);
792
+ const rateLimiters = {
793
+ crash: new RateLimiter(5), // 5 crashes/hr
794
+ hang: new RateLimiter(5), // 5 hangs/hr
795
+ stuck: new RateLimiter(2), // 2 stalls/hr (with active tabs only)
796
+ leak: new RateLimiter(2), // 2 leak alerts/hr
797
+ _default: new RateLimiter(config.crashReportRateLimit || 10),
798
+ };
793
799
  const version = config.version || 'unknown';
794
800
 
795
801
  let watchdogInterval = null;
@@ -816,7 +822,9 @@ export function createReporter(config) {
816
822
 
817
823
  /** Core: file or deduplicate a report. NEVER throws. */
818
824
  async function fileReport(type, labels, detail) {
819
- if (!rateLimiter.tryAcquire()) return;
825
+ const bucket = type.startsWith('stuck:') ? 'stuck' : type.startsWith('hang:') ? 'hang' : type.startsWith('leak:') ? 'leak' : 'crash';
826
+ const limiter = rateLimiters[bucket] || rateLimiters._default;
827
+ if (!limiter.tryAcquire()) return;
820
828
 
821
829
  const reportPromise = (async () => {
822
830
  try {
@@ -990,7 +998,7 @@ export function createReporter(config) {
990
998
 
991
999
  // Suppress false positives from OS sleep/suspend (laptop lid close, VM pause).
992
1000
  // Stalls > 120s are almost certainly not event-loop bugs.
993
- const MAX_REPORTABLE_DRIFT_MS = 120_000;
1001
+ const MAX_REPORTABLE_DRIFT_MS = 60_000;
994
1002
  let suppressTicksRemaining = 0;
995
1003
  const SUPPRESS_TICKS_AFTER_WAKE = 5;
996
1004
 
@@ -1100,6 +1108,11 @@ export function createReporter(config) {
1100
1108
  // Remove resourceOpts from extra so it doesn't end up in context
1101
1109
  delete extra.resourceOpts;
1102
1110
 
1111
+ // Don't report idle-server stalls — no user impact
1112
+ if ((resources.activeTabs || 0) === 0 && (resources.browserContexts || 0) === 0) {
1113
+ return;
1114
+ }
1115
+
1103
1116
  // Event loop delay histogram snapshot
1104
1117
  let elDelay = null;
1105
1118
  if (elHistogram) {
@@ -1118,6 +1131,8 @@ export function createReporter(config) {
1118
1131
 
1119
1132
  fileReport('stuck:event-loop', labels, {
1120
1133
  message: `Event loop stalled for ${Math.round(drift / 1000)}s (threshold: ${Math.round(thresholdMs / 1000)}s)`,
1134
+ // Stable signature: duration is NOT included — all stalls on the same route dedup
1135
+ error: { name: 'EventLoopStall', message: _lastRoute || 'idle', stack: '' },
1121
1136
  uptimeMinutes: typeof process !== 'undefined'
1122
1137
  ? Math.round(process.uptime() / 60) : undefined,
1123
1138
  resources,
@@ -1177,6 +1192,6 @@ export function createReporter(config) {
1177
1192
  resetNativeMemBaseline,
1178
1193
  _anonymize: anonymize,
1179
1194
  _stackSignature: stackSignature,
1180
- _rateLimiter: rateLimiter,
1195
+ _rateLimiter: rateLimiters,
1181
1196
  };
1182
1197
  }
@@ -2,7 +2,7 @@
2
2
  "id": "camofox-browser",
3
3
  "name": "Camofox Browser",
4
4
  "description": "Anti-detection browser automation for AI agents using Camoufox (Firefox-based)",
5
- "version": "1.7.3",
5
+ "version": "1.7.4",
6
6
  "configSchema": {
7
7
  "type": "object",
8
8
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askjo/camofox-browser",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "description": "Headless browser automation server and OpenClaw plugin for AI agents - anti-detection, element refs, and session isolation",
5
5
  "type": "module",
6
6
  "main": "server.js",
package/server.js CHANGED
@@ -55,7 +55,7 @@ function _browserPid() {
55
55
  function _resourceOpts() {
56
56
  return { sessionCount: sessions.size, tabCount: _countTabs(), browserPid: _browserPid() };
57
57
  }
58
- reporter.startWatchdog(5000, () => {
58
+ reporter.startWatchdog(30_000, () => {
59
59
  const summary = [];
60
60
  for (const [sid, session] of sessions) {
61
61
  const tabUrls = [];