You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by as...@apache.org on 2026/09/07 00:26:29 UTC

(maka) 14/15: fix(runtime): keep the compaction notes on the ledger after the rebase

This is an automated email from the ASF dual-hosted git repository.

Astro-Han pushed a commit to branch refactor/4791-single-transcript-authority
in repository https://gitbox.apache.org/repos/asf/maka.git

commit a32e71a2c31dd5d6b139d836708465c96e78e344
Author: AstroHan <le...@outlook.com>
AuthorDate: Mon Sep 7 08:22:55 2026 +0800

    fix(runtime): keep the compaction notes on the ledger after the rebase
    
    main's #4850 fix writes both compaction decision notes the moment a stage
    reports the fold, so a stopped turn still records why. This branch had moved
    turn-scoped notes off `appendMessage` onto the invocation's own ledger, and
    the two changes met in the same block: the note helper wrote StoredMessages
    directly, and the settlement fallback still used the pre-#4850 shape.
    
    Route the decision-time notes through `recordSystemNote` and let it report
    whether the append landed, so the per-send flags keep #4850's contract — a
    failed early write leaves the settlement fallback armed.
    
    Generated-by: Claude Code
---
 packages/runtime/src/__tests__/ai-sdk-backend.test.ts | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/packages/runtime/src/__tests__/ai-sdk-backend.test.ts b/packages/runtime/src/__tests__/ai-sdk-backend.test.ts
index 6baf558e54..c98dbfed28 100644
--- a/packages/runtime/src/__tests__/ai-sdk-backend.test.ts
+++ b/packages/runtime/src/__tests__/ai-sdk-backend.test.ts
@@ -5507,6 +5507,9 @@ describe('AiSdkBackend model history', () => {
       appendMessage: async (message: StoredMessage) => {
         appended.push(message as unknown as { type: string; kind?: string; data?: unknown });
       },
+      recordSystemNote: async (kind, _turnId, data) => {
+        appended.push({ type: 'system_note', kind, data });
+      },
       connection: connection(),
       apiKey: 'sk-test',
       modelId: 'mock-model-id',
@@ -5584,6 +5587,9 @@ describe('AiSdkBackend model history', () => {
       appendMessage: async (message: StoredMessage) => {
         appended.push(message as unknown as { type: string; kind?: string });
       },
+      recordSystemNote: async (kind) => {
+        appended.push({ type: 'system_note', kind });
+      },
       connection: connection(),
       apiKey: 'sk-test',
       modelId: 'mock-model-id',
@@ -5646,7 +5652,10 @@ describe('AiSdkBackend model history', () => {
       sessionId: 'session-1',
       header: header(),
       appendMessage: async (message: StoredMessage) => {
-        const candidate = message as unknown as { type: string; kind?: string };
+        persisted.push(message as unknown as { type: string; kind?: string });
+      },
+      recordSystemNote: async (kind) => {
+        const candidate = { type: 'system_note', kind };
         if (isFailOpenNote(candidate)) {
           noteWriteAttempts += 1;
           if (failNextNoteWrite) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org