feat(FN-2119): merge fusion/fn-2119

This commit is contained in:
gsxdsm
2026-04-19 03:21:38 -07:00
parent 3f8a2e9442
commit bbc0ce89be
13 changed files with 122 additions and 14 deletions

View File

@@ -44,7 +44,8 @@ export function isUsageLimitError(errorMessage: string): boolean {
/**
* Lightweight coordinator that agents call when they detect usage-limit errors.
* Triggers the global pause mechanism by calling `store.updateSettings({ globalPause: true })`.
* Triggers the global pause mechanism by calling
* `store.updateSettings({ globalPause: true, globalPauseReason: "rate-limit" })`.
*
* **Idempotency:** Tracks an internal `paused` flag so that multiple concurrent
* agents hitting limits only trigger one pause. The flag resets when `globalPause`
@@ -107,7 +108,7 @@ export class UsageLimitPauser {
);
// Activate global pause
await this.store.updateSettings({ globalPause: true });
await this.store.updateSettings({ globalPause: true, globalPauseReason: "rate-limit" });
log.warn("⚠ Global pause activated — all automated activity will halt");
}