fix(FN-703): fix overly broad usage limit pattern and add transient error retry

- Narrow 'insufficient' usage-limit regex to require quota/credit/balance/fund context
- Add transient error detection in executor and triage to retry instead of failing
- Improve scheduler pause/resume logging with actionable messages and resume confirmation
- Add SSE active connection counter for observability
- Add duplicate usage-limit pause suppression logging
This commit is contained in:
gsxdsm
2026-04-02 13:29:48 -07:00
parent 07d7c13ef0
commit e6dc02354b
5 changed files with 37 additions and 3 deletions

View File

@@ -27,7 +27,7 @@ const USAGE_LIMIT_PATTERNS: RegExp[] = [
/quota/i,
/billing/i,
/\bcredit/i,
/insufficient/i,
/insufficient.*(quota|credit|balance|fund)/i,
];
/**
@@ -88,6 +88,7 @@ export class UsageLimitPauser {
const settings = await this.store.getSettings();
if (settings.globalPause) {
// Still paused — no need to trigger again
log.log(`Global pause already active — ignoring duplicate from ${agentType}/${taskId}`);
return;
}
// External reset detected — allow re-triggering
@@ -97,6 +98,7 @@ export class UsageLimitPauser {
this.paused = true;
log.warn(`${agentType} hit usage limit on ${taskId}: ${errorMessage}`);
log.warn(`Matched pattern in error: "${errorMessage.slice(0, 200)}"`);
// Log the triggering error on the task
await this.store.logEntry(