@oh-my-pi/snapcompact 15.12.0 → 15.12.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/CHANGELOG.md +6 -0
- package/package.json +4 -4
- package/src/snapcompact.ts +11 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [15.12.1] - 2026-06-12
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- `serializeConversation` now skips tool call/result pairs whose result is flagged contextually useless (`useless: true`, non-error), so archived frames stop carrying zero-match searches and timed-out waits
|
|
10
|
+
|
|
5
11
|
## [15.11.7] - 2026-06-12
|
|
6
12
|
|
|
7
13
|
### Added
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/snapcompact",
|
|
4
|
-
"version": "15.12.
|
|
4
|
+
"version": "15.12.2",
|
|
5
5
|
"description": "Bitmap-frame context compression for vision-capable LLMs",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"fmt": "biome format --write ."
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@oh-my-pi/pi-ai": "15.12.
|
|
35
|
-
"@oh-my-pi/pi-natives": "15.12.
|
|
36
|
-
"@oh-my-pi/pi-utils": "15.12.
|
|
34
|
+
"@oh-my-pi/pi-ai": "15.12.2",
|
|
35
|
+
"@oh-my-pi/pi-natives": "15.12.2",
|
|
36
|
+
"@oh-my-pi/pi-utils": "15.12.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/bun": "^1.3.14"
|
package/src/snapcompact.ts
CHANGED
|
@@ -654,6 +654,15 @@ export function serializeConversation(messages: Message[], options?: SerializeOp
|
|
|
654
654
|
const dimToolResults = options?.dimToolResults !== false;
|
|
655
655
|
const parts: string[] = [];
|
|
656
656
|
|
|
657
|
+
// Tool results flagged contextually useless (and their paired calls) carry
|
|
658
|
+
// no information worth archiving — skip the whole pair.
|
|
659
|
+
const uselessCallIds = new Set<string>();
|
|
660
|
+
for (const msg of messages) {
|
|
661
|
+
if (msg.role === "toolResult" && msg.useless === true && msg.isError !== true) {
|
|
662
|
+
uselessCallIds.add(msg.toolCallId);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
|
|
657
666
|
for (const msg of messages) {
|
|
658
667
|
if (msg.role === "user") {
|
|
659
668
|
const content =
|
|
@@ -675,6 +684,7 @@ export function serializeConversation(messages: Message[], options?: SerializeOp
|
|
|
675
684
|
} else if (block.type === "thinking") {
|
|
676
685
|
thinkingParts.push(stripDimMarkers(block.thinking));
|
|
677
686
|
} else if (block.type === "toolCall") {
|
|
687
|
+
if (uselessCallIds.has(block.id)) continue;
|
|
678
688
|
const args = block.arguments as Record<string, unknown>;
|
|
679
689
|
const argsStr = truncateForSummary(
|
|
680
690
|
Object.entries(args)
|
|
@@ -700,6 +710,7 @@ export function serializeConversation(messages: Message[], options?: SerializeOp
|
|
|
700
710
|
parts.push(`[Assistant tool calls]: ${toolCalls.join("; ")}`);
|
|
701
711
|
}
|
|
702
712
|
} else if (msg.role === "toolResult") {
|
|
713
|
+
if (uselessCallIds.has(msg.toolCallId)) continue;
|
|
703
714
|
const content = msg.content
|
|
704
715
|
.filter((block): block is { type: "text"; text: string } => block.type === "text")
|
|
705
716
|
.map(block => block.text)
|