@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 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. Hiding a hash does not recover evidence.
61
- if (CCR_MARKER.test(nextText))
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))
@@ -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. Hiding a hash does not recover evidence.
91
- if (CCR_MARKER.test(nextText)) return { ok: false, reason: "unrecoverable-ccr-marker" };
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raquezha/noheadroom",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Personal Headroom compression bridge for Pi with Docker-first defaults and Pi tool-name adaptation",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",