opencode-lore 0.4.2 → 0.4.3
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/package.json +1 -1
- package/src/gradient.ts +6 -1
package/package.json
CHANGED
package/src/gradient.ts
CHANGED
|
@@ -876,7 +876,12 @@ function transformInner(input: {
|
|
|
876
876
|
expectedInput = messageTokens + overhead + ltmTokens;
|
|
877
877
|
}
|
|
878
878
|
|
|
879
|
-
|
|
879
|
+
// When uncalibrated, apply safety multiplier to the layer-0 decision too.
|
|
880
|
+
// chars/3 undercounts by ~1.63x on real sessions — without this, a session
|
|
881
|
+
// estimated at 146K passes layer 0 but actually costs 214K → overflow.
|
|
882
|
+
const layer0Input = calibrated ? expectedInput : expectedInput * UNCALIBRATED_SAFETY;
|
|
883
|
+
|
|
884
|
+
if (effectiveMinLayer === 0 && layer0Input <= maxInput) {
|
|
880
885
|
// All messages fit — return unmodified to preserve append-only prompt-cache pattern.
|
|
881
886
|
// Raw messages are strictly better context than lossy distilled summaries.
|
|
882
887
|
const messageTokens = calibrated
|