dsh-llm-fallbacks 0.4.1 → 0.4.2
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/dist/index.js +2 -1
- package/dist/state.d.ts +12 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -925,7 +925,8 @@ var FallbackStateStore = class {
|
|
|
925
925
|
if (mode !== "half-open") return;
|
|
926
926
|
for (const key of state.cooldown.keys()) this.isSuppressed(state, key, now, mode);
|
|
927
927
|
}
|
|
928
|
-
observeSuccess(state, key) {
|
|
928
|
+
observeSuccess(state, key, now = Date.now()) {
|
|
929
|
+
if (state.cooldown.peek(key) !== void 0) this.isSuppressed(state, key, now, "half-open");
|
|
929
930
|
state.recovery.close(key);
|
|
930
931
|
}
|
|
931
932
|
};
|
package/dist/state.d.ts
CHANGED
|
@@ -169,9 +169,17 @@ export declare class FallbackStateStore {
|
|
|
169
169
|
*/
|
|
170
170
|
syncRecovery(state: AgentFallbackState, now: number, mode: RecoveryPolicy): void;
|
|
171
171
|
/**
|
|
172
|
-
* Observed completion ⇒ close the circuit (plan P2 rule 6)
|
|
173
|
-
* the
|
|
174
|
-
*
|
|
172
|
+
* Observed completion ⇒ close the circuit (plan P2 rule 6). The lazy
|
|
173
|
+
* expiry runs FIRST — the same read the decision path performs — so a
|
|
174
|
+
* cooldown that lapsed BEFORE this completion is treated as what it is:
|
|
175
|
+
* an expired suppression, not an active one. The completion is
|
|
176
|
+
* post-expiry evidence and closes the circuit even when no decision-path
|
|
177
|
+
* read has transitioned the entry to half-open yet (a manual
|
|
178
|
+
* re-selection of the route, or a route no walk ever consulted because the
|
|
179
|
+
* current route kept succeeding). An ACTIVE suppression (`until > now`,
|
|
180
|
+
* including the `Infinity` of `revertPolicy: 'never'`) is untouched:
|
|
181
|
+
* a stale in-flight success must not cancel a fresher escalated
|
|
182
|
+
* re-suppression.
|
|
175
183
|
*/
|
|
176
|
-
observeSuccess(state: AgentFallbackState, key: string): void;
|
|
184
|
+
observeSuccess(state: AgentFallbackState, key: string, now?: number): void;
|
|
177
185
|
}
|