@raquezha/noheadroom 0.3.4 → 0.3.5
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/bridge.js +4 -2
- package/extensions/bridge.ts +5 -2
- package/package.json +1 -1
package/dist/bridge.js
CHANGED
|
@@ -57,9 +57,11 @@ export function applyCompressionResult(originalMessages, mappings, compressedMes
|
|
|
57
57
|
const nextText = extractOpenAIText(compressed);
|
|
58
58
|
if (nextText === mapping.originalText)
|
|
59
59
|
continue;
|
|
60
|
-
// No retrieval executor is registered.
|
|
61
|
-
|
|
60
|
+
// No retrieval executor is registered. Reject only a marker created by this response:
|
|
61
|
+
// prior session history can already contain one and must not disable later safe compaction.
|
|
62
|
+
if (CCR_MARKER.test(nextText) && !CCR_MARKER.test(mapping.originalText)) {
|
|
62
63
|
return { ok: false, reason: "unrecoverable-ccr-marker" };
|
|
64
|
+
}
|
|
63
65
|
if (!nextText.trim())
|
|
64
66
|
return { ok: false, reason: "empty-compressed-content" };
|
|
65
67
|
if (estimateTokens(nextText) >= estimateTokens(mapping.originalText))
|
package/extensions/bridge.ts
CHANGED
|
@@ -87,8 +87,11 @@ export function applyCompressionResult(
|
|
|
87
87
|
|
|
88
88
|
const nextText = extractOpenAIText(compressed);
|
|
89
89
|
if (nextText === mapping.originalText) continue;
|
|
90
|
-
// No retrieval executor is registered.
|
|
91
|
-
|
|
90
|
+
// No retrieval executor is registered. Reject only a marker created by this response:
|
|
91
|
+
// prior session history can already contain one and must not disable later safe compaction.
|
|
92
|
+
if (CCR_MARKER.test(nextText) && !CCR_MARKER.test(mapping.originalText)) {
|
|
93
|
+
return { ok: false, reason: "unrecoverable-ccr-marker" };
|
|
94
|
+
}
|
|
92
95
|
if (!nextText.trim()) return { ok: false, reason: "empty-compressed-content" };
|
|
93
96
|
if (estimateTokens(nextText) >= estimateTokens(mapping.originalText)) continue;
|
|
94
97
|
|
package/package.json
CHANGED