@wrongstack/core 0.8.2 → 0.8.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/dist/defaults/index.js +11 -5
- package/dist/defaults/index.js.map +1 -1
- package/dist/execution/index.d.ts +10 -4
- package/dist/execution/index.js +11 -5
- package/dist/execution/index.js.map +1 -1
- package/dist/index.d.ts +416 -2
- package/dist/index.js +896 -33
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -204,10 +204,16 @@ declare class AutoCompactionMiddleware {
|
|
|
204
204
|
private readonly failureMode;
|
|
205
205
|
private readonly policyProvider?;
|
|
206
206
|
/**
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
207
|
+
* Calibration factor applied to the estimator output. The estimator is now
|
|
208
|
+
* expected to already include messages + system prompt + tool definitions
|
|
209
|
+
* (see `estimateRequestTokens.total`), so no overhead boost is needed. Kept
|
|
210
|
+
* as a constant so a future calibration against real provider tokenization
|
|
211
|
+
* (BPE vs the chars/3.5 rough estimator) can dial this without touching the
|
|
212
|
+
* threshold-check math.
|
|
213
|
+
*
|
|
214
|
+
* Historical note: was 1.3 when the estimator only counted messages — that
|
|
215
|
+
* double-counted system+tools once the estimator was upgraded, firing
|
|
216
|
+
* compaction ~30% earlier than intended (e.g. real 56% load showed as 73%).
|
|
211
217
|
*/
|
|
212
218
|
private static readonly OVERHEAD_FACTOR;
|
|
213
219
|
/**
|
package/dist/execution/index.js
CHANGED
|
@@ -1019,12 +1019,18 @@ var AutoCompactionMiddleware = class _AutoCompactionMiddleware {
|
|
|
1019
1019
|
failureMode;
|
|
1020
1020
|
policyProvider;
|
|
1021
1021
|
/**
|
|
1022
|
-
*
|
|
1023
|
-
*
|
|
1024
|
-
*
|
|
1025
|
-
*
|
|
1022
|
+
* Calibration factor applied to the estimator output. The estimator is now
|
|
1023
|
+
* expected to already include messages + system prompt + tool definitions
|
|
1024
|
+
* (see `estimateRequestTokens.total`), so no overhead boost is needed. Kept
|
|
1025
|
+
* as a constant so a future calibration against real provider tokenization
|
|
1026
|
+
* (BPE vs the chars/3.5 rough estimator) can dial this without touching the
|
|
1027
|
+
* threshold-check math.
|
|
1028
|
+
*
|
|
1029
|
+
* Historical note: was 1.3 when the estimator only counted messages — that
|
|
1030
|
+
* double-counted system+tools once the estimator was upgraded, firing
|
|
1031
|
+
* compaction ~30% earlier than intended (e.g. real 56% load showed as 73%).
|
|
1026
1032
|
*/
|
|
1027
|
-
static OVERHEAD_FACTOR = 1
|
|
1033
|
+
static OVERHEAD_FACTOR = 1;
|
|
1028
1034
|
/**
|
|
1029
1035
|
* Once a compaction attempt reduces nothing (preserveK protects everything,
|
|
1030
1036
|
* no oversized tool_results remain to elide), retrying on every iteration
|