@sayknow-cli/agent-core 0.7.8 → 0.7.9
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 +10 -0
- package/package.json +4 -4
- package/src/agent-loop.ts +21 -2
- package/src/compaction/utils.ts +2 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.7.9] - 2026-10-17
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Compaction and branch summaries no longer paste assistant thinking into the summarization prompt; `serializeConversation` emits only visible assistant text, tool calls, user messages, and tool results.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Fallback-managed runs keep replay metadata on committed assistant content: `thinkingSignature`, `itemId`, `provenance`, `summaryText`, and `rawText` on thinking blocks and `textSignature` on text blocks. Dropping them made every managed turn persist unsigned thinking, which later requests replayed as plain text instead of signed reasoning.
|
|
14
|
+
|
|
5
15
|
## [0.7.8] - 2026-10-09
|
|
6
16
|
|
|
7
17
|
### Changed
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@sayknow-cli/agent-core",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.9",
|
|
5
5
|
"description": "General-purpose agent with transport abstraction, state management, and attachment support",
|
|
6
6
|
"homepage": "https://sayknow-cli.com",
|
|
7
7
|
"author": "jaybeyond",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"fmt": "biome format --write ."
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@sayknow-cli/ai": "0.7.
|
|
39
|
-
"@sayknow-cli/natives": "0.7.
|
|
40
|
-
"@sayknow-cli/utils": "0.7.
|
|
38
|
+
"@sayknow-cli/ai": "0.7.9",
|
|
39
|
+
"@sayknow-cli/natives": "0.7.9",
|
|
40
|
+
"@sayknow-cli/utils": "0.7.9",
|
|
41
41
|
"@opentelemetry/api": "^1.9.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
package/src/agent-loop.ts
CHANGED
|
@@ -666,11 +666,30 @@ function managedAssistantContent(value: unknown): AssistantMessage["content"][nu
|
|
|
666
666
|
const type = managedProperty(value, "type");
|
|
667
667
|
if (type === "text") {
|
|
668
668
|
const text = managedProperty(value, "text");
|
|
669
|
-
|
|
669
|
+
if (typeof text !== "string") return undefined;
|
|
670
|
+
const textSignature = managedProperty(value, "textSignature");
|
|
671
|
+
return { type, text, ...(typeof textSignature === "string" ? { textSignature } : {}) };
|
|
670
672
|
}
|
|
671
673
|
if (type === "thinking") {
|
|
672
674
|
const thinking = managedProperty(value, "thinking");
|
|
673
|
-
|
|
675
|
+
if (typeof thinking !== "string") return undefined;
|
|
676
|
+
// Replay metadata must survive the shell: without `thinkingSignature` the
|
|
677
|
+
// provider can no longer replay this block as native signed thinking and
|
|
678
|
+
// degrades the private reasoning to plain assistant text on later requests.
|
|
679
|
+
const thinkingSignature = managedProperty(value, "thinkingSignature");
|
|
680
|
+
const itemId = managedProperty(value, "itemId");
|
|
681
|
+
const provenance = managedProperty(value, "provenance");
|
|
682
|
+
const summaryText = managedProperty(value, "summaryText");
|
|
683
|
+
const rawText = managedProperty(value, "rawText");
|
|
684
|
+
return {
|
|
685
|
+
type,
|
|
686
|
+
thinking,
|
|
687
|
+
...(typeof thinkingSignature === "string" ? { thinkingSignature } : {}),
|
|
688
|
+
...(typeof itemId === "string" ? { itemId } : {}),
|
|
689
|
+
...(provenance === "summary" || provenance === "raw" || provenance === "mixed" ? { provenance } : {}),
|
|
690
|
+
...(typeof summaryText === "string" ? { summaryText } : {}),
|
|
691
|
+
...(typeof rawText === "string" ? { rawText } : {}),
|
|
692
|
+
};
|
|
674
693
|
}
|
|
675
694
|
if (type === "redactedThinking") {
|
|
676
695
|
const data = managedProperty(value, "data");
|
package/src/compaction/utils.ts
CHANGED
|
@@ -138,14 +138,13 @@ export function serializeConversation(messages: Message[]): string {
|
|
|
138
138
|
if (content) parts.push(`[User]: ${content}`);
|
|
139
139
|
} else if (msg.role === "assistant") {
|
|
140
140
|
const textParts: string[] = [];
|
|
141
|
-
const thinkingParts: string[] = [];
|
|
142
141
|
const toolCalls: string[] = [];
|
|
143
142
|
|
|
143
|
+
// Thinking is private model reasoning; summarize only what the assistant
|
|
144
|
+
// visibly said and did, never paste prior reasoning into the summary prompt.
|
|
144
145
|
for (const block of msg.content) {
|
|
145
146
|
if (block.type === "text") {
|
|
146
147
|
textParts.push(block.text);
|
|
147
|
-
} else if (block.type === "thinking") {
|
|
148
|
-
thinkingParts.push(block.thinking);
|
|
149
148
|
} else if (block.type === "toolCall") {
|
|
150
149
|
// `arguments` is typed non-null, but persisted history can carry a
|
|
151
150
|
// null/non-object payload from an aborted or malformed tool call.
|
|
@@ -159,9 +158,6 @@ export function serializeConversation(messages: Message[]): string {
|
|
|
159
158
|
}
|
|
160
159
|
}
|
|
161
160
|
|
|
162
|
-
if (thinkingParts.length > 0) {
|
|
163
|
-
parts.push(`[Assistant thinking]: ${thinkingParts.join("\n")}`);
|
|
164
|
-
}
|
|
165
161
|
if (textParts.length > 0) {
|
|
166
162
|
parts.push(`[Assistant]: ${textParts.join("\n")}`);
|
|
167
163
|
}
|