@sayknow-cli/agent-core 0.7.7 → 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 CHANGED
@@ -2,6 +2,22 @@
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
+
15
+ ## [0.7.8] - 2026-10-09
16
+
17
+ ### Changed
18
+
19
+ - `hideThinkingSummary` is display-only state and is no longer forwarded to the provider. Asking a provider to omit reasoning made long thinking stream only keepalives, so the idle watchdog aborted healthy answers as stalled. Callers that need provider-side omission set `SimpleStreamOptions.hideThinkingSummary` on the stream call directly.
20
+
5
21
  ## [0.7.7] - 2026-10-06
6
22
 
7
23
  ### Added
@@ -111,9 +111,9 @@ export interface AgentOptions {
111
111
  repetitionPenalty?: number;
112
112
  serviceTier?: ServiceTier;
113
113
  /**
114
- * If true, request that the underlying provider omit reasoning/thinking summaries
115
- * from the response. The model still reasons internally; only the human-readable
116
- * summary stream is suppressed. Useful when the UI hides thinking blocks anyway.
114
+ * Local display state: whether the UI hides thinking blocks. It never changes the
115
+ * provider request; reasoning keeps streaming so long thinking still counts as
116
+ * stream progress for the idle watchdog.
117
117
  */
118
118
  hideThinkingSummary?: boolean;
119
119
  /**
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.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.7",
39
- "@sayknow-cli/natives": "0.7.7",
40
- "@sayknow-cli/utils": "0.7.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
- return typeof text === "string" ? { type, text } : undefined;
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
- return typeof thinking === "string" ? { type, thinking } : undefined;
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/agent.ts CHANGED
@@ -218,9 +218,9 @@ export interface AgentOptions {
218
218
  repetitionPenalty?: number;
219
219
  serviceTier?: ServiceTier;
220
220
  /**
221
- * If true, request that the underlying provider omit reasoning/thinking summaries
222
- * from the response. The model still reasons internally; only the human-readable
223
- * summary stream is suppressed. Useful when the UI hides thinking blocks anyway.
221
+ * Local display state: whether the UI hides thinking blocks. It never changes the
222
+ * provider request; reasoning keeps streaming so long thinking still counts as
223
+ * stream progress for the idle watchdog.
224
224
  */
225
225
  hideThinkingSummary?: boolean;
226
226
 
@@ -1444,7 +1444,9 @@ export class Agent {
1444
1444
  presencePenalty: this.#presencePenalty,
1445
1445
  repetitionPenalty: this.#repetitionPenalty,
1446
1446
  serviceTier: this.#serviceTier,
1447
- hideThinkingSummary: this.#hideThinkingSummary,
1447
+ // Hiding thinking is a local display preference and never changes the request:
1448
+ // a provider told to omit reasoning streams only keepalives during long
1449
+ // thinking, and the idle watchdog then cuts a healthy answer as stalled.
1448
1450
  interruptMode: this.#interruptMode,
1449
1451
  sessionId: this.#sessionId,
1450
1452
  providerSessionId: this.#providerSessionId,
@@ -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
  }