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/08/26 16:14:54 UTC
(maka) 24/27: fix(runtime-host): bind exact-Turn intent into durable Message identity
This is an automated email from the ASF dual-hosted git repository.
Astro-Han pushed a commit to branch fix/canonical-message-projection
in repository https://gitbox.apache.org/repos/asf/maka.git
commit dd25ed9198490e56ed2b21c8b442fe8bd9146bb7
Author: AstroHan <le...@outlook.com>
AuthorDate: Wed Aug 26 15:14:10 2026 +0800
fix(runtime-host): bind exact-Turn intent into durable Message identity
`turn.message.submit` gained `skillIds` and `turnOrchestration`, but nothing
that decides whether a retry is the same submit was told about them.
Durable replay compared only message id, content digest and placement, so
submitting one Message identity as a graph Turn and retrying it as a swarm
Turn was answered with the graph Turn's success. The root admission now
records a digest of the exact-Turn intent alongside the content digest, and
the retry comparison covers it. A receipt carrying no intent digest was
written for a submit that asked for none, so any intent on a retry is a
different request — the comparison fails closed.
Pending Message admission stored no execution mode either. Admission commits
before the root admission that carries it, so a Host that stopped between the
two recovered the Message and re-opened it under the Session default rather
than the graph or swarm the user asked for. The mode is now part of the
pending record (schema 32) and travels with the recovery batch into the
recovered Turn.
Two test doubles were rebuilding records from parts instead of storing what
the coordinator produced, which is why neither gap showed up; they store the
real thing now.
Generated-by: Claude Code
---
.../src/__tests__/message-coordinator.test.ts | 99 ++++++++++++++++++++--
.../runtime-host/src/server/message-coordinator.ts | 48 ++++++++++-
.../src/server/root-turn-coordinator.ts | 4 +
.../sqlite-session-metadata-store.test.ts | 3 +
packages/storage/src/agent-run-store.ts | 23 ++++-
packages/storage/src/message-admission-store.ts | 28 ++++++
.../storage/src/sqlite-session-metadata-schema.ts | 15 +++-
.../storage/src/sqlite-session-metadata-store.ts | 29 +++++--
8 files changed, 227 insertions(+), 22 deletions(-)
diff --git a/packages/runtime-host/src/__tests__/message-coordinator.test.ts b/packages/runtime-host/src/__tests__/message-coordinator.test.ts
index 4ac57c931..39ca6852d 100644
--- a/packages/runtime-host/src/__tests__/message-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/message-coordinator.test.ts
@@ -37,6 +37,7 @@ import {
HostMessageCoordinator,
type HostMessageCoordinatorOptions,
type HostMessageRootPort,
+ type HostMessageRecoveryBatch,
type HostMessageRootState,
} from '../server/message-coordinator.js';
import { SessionAdmissionGate } from '../server/session-admission-gate.js';
@@ -72,6 +73,43 @@ test('idle submit starts exactly one root Turn and retry identity is connection-
assert.equal(fixture.liveResidencies(), 0);
});
+test('a retry that changes exact-Turn intent is a conflict, not the earlier success', async () => {
+ const fixture = createFixture();
+ fixture.setRootState({ kind: 'idle' });
+ const submitted = (mode: 'graph' | 'swarm') =>
+ ({
+ originHostEpoch: 'epoch-1',
+ sessionId: ROOT.sessionId,
+ messageId: 'exact-message',
+ content: { text: 'run this exactly' },
+ placement: 'current_turn',
+ turnOrchestration: { mode, source: 'slash_command' },
+ }) as const;
+
+ const first = await fixture.coordinator.handlers['turn.message.submit'](
+ submitted('graph'),
+ operationContext(),
+ );
+ assert.equal(first.ok, true);
+
+ // Same Message identity, same text, same placement — but a different
+ // execution mode. Answering the earlier success here would run one exact
+ // request and report it as another.
+ const changed = await fixture.coordinator.handlers['turn.message.submit'](
+ submitted('swarm'),
+ operationContext(),
+ );
+ assert.equal(changed.ok, false);
+ if (!changed.ok) assert.equal(changed.error.code, 'operation_conflict');
+
+ const unchanged = await fixture.coordinator.handlers['turn.message.submit'](
+ submitted('graph'),
+ operationContext(),
+ );
+ assert.deepEqual(unchanged, first);
+ assert.equal(fixture.startCalls(), 1);
+});
+
test('message query reports only durable cancellation proof', async () => {
const fixture = createFixture();
fixture.coordinator.reserveRootTurn(ROOT);
@@ -314,6 +352,34 @@ test('recovered followups without a connection owner still form one successor ba
);
});
+test('recovery re-opens a Turn under the orchestration the Message asked for', async () => {
+ const fixture = createFixture();
+ fixture.setRootState({ kind: 'idle' });
+ // The Host stopped after the Message admission committed and before the root
+ // admission that carries the execution mode was written.
+ await fixture.admissions.commitMessageAdmission({
+ sessionId: ROOT.sessionId,
+ turnId: ROOT.turnId,
+ runId: ROOT.runId,
+ messageId: 'recovered-exact',
+ content: { text: 'run this as a graph' },
+ submittedContentDigest: messageContentDigest({ text: 'run this as a graph' }),
+ submittedPlacement: 'current_turn',
+ placement: 'current_turn',
+ disposition: 'steering',
+ turnOrchestration: { mode: 'graph', source: 'slash_command' },
+ admittedAt: 1,
+ });
+
+ await fixture.coordinator.recoverPendingAfterHostRestart([ROOT.sessionId]);
+
+ assert.equal(fixture.recoveredBatches.length, 1);
+ assert.deepEqual(fixture.recoveredBatches[0]?.turnOrchestration, {
+ mode: 'graph',
+ source: 'slash_command',
+ });
+});
+
test('recovery treats a durable steering event as the handoff proof', async () => {
const fixture = createFixture();
await fixture.admissions.commitMessageAdmission({
@@ -2154,6 +2220,7 @@ function createFixture(
}
| undefined;
const receipts = new Map<string, RootTurnSourceMessageReceipt>();
+ const recoveredBatches: HostMessageRecoveryBatch[] = [];
const events: RuntimeEvent[] = [];
const messageAdmissions = new Map<
string,
@@ -2192,20 +2259,35 @@ function createFixture(
startFromMessage: async (input) => {
startCalls += 1;
const turnId = 'idle-turn';
- receipts.set(
+ // Store the source message the coordinator actually produced. Rebuilding
+ // one from parts drops whatever the coordinator recorded about the
+ // submit, which is the very thing a retry is compared against.
+ const receipt = sourceReceipt(
input.sourceMessage.messageId,
- sourceReceipt(
- input.sourceMessage.messageId,
- input.sourceMessage.content,
- input.sourceMessage.placement,
- 'turn_started',
- turnId,
- ),
+ input.sourceMessage.content,
+ input.sourceMessage.placement,
+ 'turn_started',
+ turnId,
);
+ receipts.set(input.sourceMessage.messageId, {
+ admission: {
+ ...receipt.admission,
+ sourceMessages: [input.sourceMessage],
+ ...(input.turnOrchestration ? { turnOrchestration: input.turnOrchestration } : {}),
+ },
+ sourceMessage: input.sourceMessage,
+ });
rootState = { kind: 'active', sessionId: input.sessionId, turnId, runId: 'idle-run' };
coordinator.reserveRootTurn(rootState);
return { turnId };
},
+ startRecoveredMessages: async (input) => {
+ recoveredBatches.push(input);
+ const turnId = 'recovered-turn';
+ rootState = { kind: 'active', sessionId: input.sessionId, turnId, runId: 'recovered-run' };
+ coordinator.reserveRootTurn(rootState);
+ return { turnId };
+ },
prepareMessage: (input) => prepareMessage(input),
claimStop: async (_input, commitQueueFence) => {
commitQueueFence();
@@ -2264,6 +2346,7 @@ function createFixture(
startCalls: () => startCalls,
events,
receipts,
+ recoveredBatches,
readMessageAdmission: (messageId: string) => messageAdmissions.get(messageId)?.admission,
stopClaimed,
resolveTerminal: terminal.resolve,
diff --git a/packages/runtime-host/src/server/message-coordinator.ts b/packages/runtime-host/src/server/message-coordinator.ts
index c21b121f9..88e32db58 100644
--- a/packages/runtime-host/src/server/message-coordinator.ts
+++ b/packages/runtime-host/src/server/message-coordinator.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { randomUUID } from 'node:crypto';
+import { createHash, randomUUID } from 'node:crypto';
import { isDeepStrictEqual } from 'node:util';
import type { SteeringLease } from '@maka/core/backend-types';
import {
@@ -126,6 +126,13 @@ export interface HostMessageRecoveryBatch {
readonly content: MessageContent;
readonly submittedContent: MessageContent;
readonly sources: readonly RootTurnSourceMessage[];
+ /**
+ * The execution mode the recovered Message asked for. Only a lone Message
+ * can carry one — exact-Turn intent needs an idle Session and opens its own
+ * root Turn — and without it the recovered Turn silently runs under the
+ * Session default instead of the graph or swarm that was requested.
+ */
+ readonly turnOrchestration?: TurnOrchestration;
}
export interface HostMessagePreparationInput {
@@ -694,6 +701,9 @@ export class HostMessageCoordinator implements RuntimeMessageAuthority {
content: aggregateMessageContents(pending.map((entry) => entry.content)),
submittedContent: aggregateMessageContents(pending.map((entry) => entry.content)),
sources: pending.map(pendingMessageSource),
+ ...(pending.length === 1 && pending[0]!.turnOrchestration
+ ? { turnOrchestration: pending[0]!.turnOrchestration }
+ : {}),
},
admission,
),
@@ -846,10 +856,12 @@ export class HostMessageCoordinator implements RuntimeMessageAuthority {
'Root reported idle while the message authority retained live state',
);
}
+ const intentDigest = submittedIntentDigest(payload);
const sourceMessage: RootTurnSourceMessage = {
messageId: input.messageId,
content: payload.content,
submittedContentDigest: messageContentDigest(payload.content),
+ ...(intentDigest ? { submittedIntentDigest: intentDigest } : {}),
placement: input.placement,
disposition: 'turn_started',
};
@@ -860,7 +872,8 @@ export class HostMessageCoordinator implements RuntimeMessageAuthority {
if (
pendingAdmission &&
(pendingAdmission.submittedContentDigest !== messageContentDigest(payload.content) ||
- pendingAdmission.submittedPlacement !== input.placement)
+ pendingAdmission.submittedPlacement !== input.placement ||
+ !isDeepStrictEqual(pendingAdmission.turnOrchestration, payload.turnOrchestration))
) {
return failure('operation_conflict', 'Message admission has a different payload');
}
@@ -891,6 +904,9 @@ export class HostMessageCoordinator implements RuntimeMessageAuthority {
submittedPlacement: input.placement,
placement: 'current_turn',
disposition: 'steering',
+ ...(payload.turnOrchestration
+ ? { turnOrchestration: payload.turnOrchestration }
+ : {}),
admittedAt: pendingAdmission?.admittedAt ?? Date.now(),
});
},
@@ -2128,6 +2144,12 @@ function sameRun(left: RuntimeMessageRunIdentity, right: RuntimeMessageRunIdenti
);
}
+/**
+ * Whether a durable receipt answers the submit being retried. The receipt's own
+ * record of the exact-Turn intent is authoritative; a receipt that carries none
+ * was written for a submit that asked for none, so any intent now is a
+ * different request.
+ */
function sameSourcePayload(
receipt: RootTurnSourceMessageReceipt,
input: CanonicalSubmitPayload,
@@ -2146,7 +2168,8 @@ function sameSourcePayload(
(durableDigest
? durableDigest === messageContentDigest(input.content)
: messageContentsEqual(source.content, input.content)) &&
- source.placement === input.placement
+ source.placement === input.placement &&
+ source.submittedIntentDigest === submittedIntentDigest(input)
);
}
@@ -2303,6 +2326,25 @@ function requiresExactTurn(payload: CanonicalSubmitPayload): boolean {
return payload.skillIds.length > 0 || payload.turnOrchestration !== undefined;
}
+/**
+ * The exact-Turn intent as a durable value, or undefined when the submit asked
+ * for none. Content and placement say nothing about how a Turn runs, so this is
+ * the rest of what makes a submit the same submit: without it, a retry under
+ * one Message identity can change the execution mode and still be answered with
+ * the earlier Turn's success.
+ */
+function submittedIntentDigest(payload: CanonicalSubmitPayload): `sha256:${string}` | undefined {
+ if (!requiresExactTurn(payload)) return undefined;
+ return `sha256:${createHash('sha256')
+ .update(
+ JSON.stringify({
+ skillIds: payload.skillIds,
+ turnOrchestration: payload.turnOrchestration ?? null,
+ }),
+ )
+ .digest('hex')}`;
+}
+
function aggregateMessageContent(contents: readonly MessageContent[]): MessageContent {
return aggregateMessageContents(contents);
}
diff --git a/packages/runtime-host/src/server/root-turn-coordinator.ts b/packages/runtime-host/src/server/root-turn-coordinator.ts
index f5c24faab..fb0718040 100644
--- a/packages/runtime-host/src/server/root-turn-coordinator.ts
+++ b/packages/runtime-host/src/server/root-turn-coordinator.ts
@@ -1163,6 +1163,9 @@ export class RootTurnCoordinator implements HostedExecutionAuthority {
if (!reservation) return { error: 'Another root Turn is being admitted' };
try {
const turnId = randomUUID();
+ // The recovered Message asked for this mode before the Host stopped;
+ // admitting without it would run a different Turn than was requested.
+ await this.prepareFreshAgentGraphEpoch(header, input.turnOrchestration);
const admitted = await this.rootAdmissionOwner.admitRootTurn({
sessionId: input.sessionId,
turnId,
@@ -1173,6 +1176,7 @@ export class RootTurnCoordinator implements HostedExecutionAuthority {
inputDigest: messageContentDigest(input.submittedContent),
},
normalizedInput: input.content,
+ ...(input.turnOrchestration ? { turnOrchestration: input.turnOrchestration } : {}),
sourceMessages: input.sources,
admittedAt: Date.now(),
});
diff --git a/packages/storage/src/__tests__/sqlite-session-metadata-store.test.ts b/packages/storage/src/__tests__/sqlite-session-metadata-store.test.ts
index f0b771fd5..6559d971c 100644
--- a/packages/storage/src/__tests__/sqlite-session-metadata-store.test.ts
+++ b/packages/storage/src/__tests__/sqlite-session-metadata-store.test.ts
@@ -321,6 +321,9 @@ describe('SqliteSessionMetadataStore', () => {
submittedPlacement: 'current_turn',
placement: 'current_turn',
disposition: 'steering',
+ // Exact-Turn intent is durable: recovery re-opens the Turn from this
+ // record, and content and placement say nothing about execution mode.
+ turnOrchestration: { mode: 'graph', source: 'slash_command' },
admittedAt: 10,
};
diff --git a/packages/storage/src/agent-run-store.ts b/packages/storage/src/agent-run-store.ts
index 9b1af4fe7..716d9e5c0 100644
--- a/packages/storage/src/agent-run-store.ts
+++ b/packages/storage/src/agent-run-store.ts
@@ -95,6 +95,14 @@ export interface RootTurnSourceMessage {
messageId: string;
content: MessageContent;
submittedContentDigest?: `sha256:${string}`;
+ /**
+ * Digest of the exact-Turn intent this Message was submitted with — the
+ * Skill ids and the orchestration override. Content and placement do not
+ * describe it, so without this a retry that asks for a different execution
+ * mode under the same Message identity aliases the earlier success. Absent
+ * on a record written for a submit that carried no exact intent.
+ */
+ submittedIntentDigest?: `sha256:${string}`;
placement: 'current_turn' | 'next_turn';
disposition: 'steering' | 'followup' | 'turn_started';
}
@@ -1653,11 +1661,19 @@ function normalizeRootTurnSourceMessages(value: unknown): readonly RootTurnSourc
'placement',
'disposition',
...(Object.hasOwn(item, 'submittedContentDigest') ? ['submittedContentDigest'] : []),
+ ...(Object.hasOwn(item, 'submittedIntentDigest') ? ['submittedIntentDigest'] : []),
])
) {
throw new Error(`Invalid root turn source message at index ${index}`);
}
- const { messageId, content, submittedContentDigest, placement, disposition } = item;
+ const {
+ messageId,
+ content,
+ submittedContentDigest,
+ submittedIntentDigest,
+ placement,
+ disposition,
+ } = item;
if (
typeof messageId !== 'string' ||
!isSafeId(messageId) ||
@@ -1667,7 +1683,8 @@ function normalizeRootTurnSourceMessages(value: unknown): readonly RootTurnSourc
disposition !== 'turn_started') ||
(disposition === 'steering' && placement !== 'current_turn') ||
(disposition === 'followup' && placement !== 'next_turn') ||
- (submittedContentDigest !== undefined && !isSha256Digest(submittedContentDigest))
+ (submittedContentDigest !== undefined && !isSha256Digest(submittedContentDigest)) ||
+ (submittedIntentDigest !== undefined && !isSha256Digest(submittedIntentDigest))
) {
throw new Error(`Invalid root turn source message at index ${index}`);
}
@@ -1683,6 +1700,7 @@ function normalizeRootTurnSourceMessages(value: unknown): readonly RootTurnSourc
MAX_ATTACHMENT_COUNT,
),
...(submittedContentDigest !== undefined ? { submittedContentDigest } : {}),
+ ...(submittedIntentDigest !== undefined ? { submittedIntentDigest } : {}),
placement,
disposition,
});
@@ -1710,6 +1728,7 @@ function rootTurnAdmissionPayloadsEqual(
source.placement === other.placement &&
source.disposition === other.disposition &&
source.submittedContentDigest === other.submittedContentDigest &&
+ source.submittedIntentDigest === other.submittedIntentDigest &&
messageContentsEqual(source.content, other.content)
);
})
diff --git a/packages/storage/src/message-admission-store.ts b/packages/storage/src/message-admission-store.ts
index 25fe352c7..dba6e75e0 100644
--- a/packages/storage/src/message-admission-store.ts
+++ b/packages/storage/src/message-admission-store.ts
@@ -19,6 +19,11 @@
import { isDeepStrictEqual } from 'node:util';
import { normalizeMessageContent, type MessageContent } from '@maka/core/events';
+import {
+ isOrchestrationMode,
+ isTurnOrchestrationSource,
+ type TurnOrchestration,
+} from '@maka/core/orchestration';
const SAFE_ID_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;
@@ -32,6 +37,14 @@ export interface PendingMessageAdmission {
readonly submittedPlacement: 'current_turn' | 'next_turn';
readonly placement: 'current_turn' | 'next_turn';
readonly disposition: 'steering' | 'followup';
+ /**
+ * The orchestration this Message asked its Turn to run under, when it asked
+ * for one. Recovery re-opens the Turn from this record, and content and
+ * placement say nothing about execution mode, so without it a crash between
+ * this commit and the root admission silently downgrades an explicit
+ * graph or swarm request to the Session default.
+ */
+ readonly turnOrchestration?: TurnOrchestration;
readonly admittedAt: number;
}
@@ -81,9 +94,23 @@ export function normalizePendingMessageAdmission(
if (!Number.isSafeInteger(admission.admittedAt) || admission.admittedAt < 0) {
throw new Error('Invalid message admission timestamp');
}
+ if (admission.turnOrchestration !== undefined) {
+ const { mode, source } = admission.turnOrchestration;
+ if (!isOrchestrationMode(mode) || !isTurnOrchestrationSource(source)) {
+ throw new Error('Invalid pending Message orchestration');
+ }
+ }
const normalized = Object.freeze({
...admission,
content: normalizeMessageContent(admission.content),
+ ...(admission.turnOrchestration
+ ? {
+ turnOrchestration: Object.freeze({
+ mode: admission.turnOrchestration.mode,
+ source: admission.turnOrchestration.source,
+ }),
+ }
+ : {}),
});
if (!/^sha256:[a-f0-9]{64}$/u.test(normalized.submittedContentDigest)) {
throw new Error('Invalid pending Message submitted content digest');
@@ -107,6 +134,7 @@ export function samePendingMessageAdmission(
a.placement === b.placement &&
a.disposition === b.disposition &&
a.admittedAt === b.admittedAt &&
+ isDeepStrictEqual(a.turnOrchestration, b.turnOrchestration) &&
isDeepStrictEqual(a.content, b.content)
);
}
diff --git a/packages/storage/src/sqlite-session-metadata-schema.ts b/packages/storage/src/sqlite-session-metadata-schema.ts
index 2cc54783a..c168bb25d 100644
--- a/packages/storage/src/sqlite-session-metadata-schema.ts
+++ b/packages/storage/src/sqlite-session-metadata-schema.ts
@@ -19,7 +19,7 @@
import type { DatabaseSync } from 'node:sqlite';
-export const SQLITE_SESSION_METADATA_SCHEMA_VERSION = 31;
+export const SQLITE_SESSION_METADATA_SCHEMA_VERSION = 32;
export const SQLITE_SESSION_MESSAGE_CHUNK_BYTES = 64 * 1024;
export const SQLITE_SESSION_MESSAGE_CHUNK_MARKER = '{"$maka":"session-message-chunks-v1"}';
@@ -1194,6 +1194,12 @@ const MIGRATIONS: ReadonlyMap<number, string> = new Map([
WHERE json_extract(payload_json, '$.role') = 'workhub_coordination';
`,
],
+ [
+ 32,
+ `
+ ALTER TABLE message_admissions ADD COLUMN turn_orchestration_json TEXT;
+ `,
+ ],
]);
if (MIGRATIONS.size !== SQLITE_SESSION_METADATA_SCHEMA_VERSION) {
@@ -1251,7 +1257,12 @@ export function migrateSqliteSessionMetadataDatabase(
) {
const sql = MIGRATIONS.get(version);
if (!sql) throw new Error(`Missing SQLite session metadata migration ${version}`);
- db.exec(sql);
+ // Version 32 adds one column, and the post-merge convergence path replays
+ // it onto a database that may already carry it. SQLite has no
+ // `ADD COLUMN IF NOT EXISTS`, so the guard lives here.
+ if (version !== 32 || !hasColumn(db, 'message_admissions', 'turn_orchestration_json')) {
+ db.exec(sql);
+ }
if (version === 29 && hasColumn(db, 'session_metadata', 'last_used_at')) {
db.exec('ALTER TABLE session_metadata DROP COLUMN last_used_at');
}
diff --git a/packages/storage/src/sqlite-session-metadata-store.ts b/packages/storage/src/sqlite-session-metadata-store.ts
index 8eb75134a..9f4f6750c 100644
--- a/packages/storage/src/sqlite-session-metadata-store.ts
+++ b/packages/storage/src/sqlite-session-metadata-store.ts
@@ -247,6 +247,7 @@ interface MessageAdmissionRow {
readonly disposition?: unknown;
readonly queue_order?: unknown;
readonly admitted_at?: unknown;
+ readonly turn_orchestration_json?: unknown;
}
function decodeMessageAdmissionRow(
@@ -280,6 +281,13 @@ function decodeMessageAdmissionRow(
submittedPlacement: row.submitted_placement,
placement: row.placement,
disposition: row.disposition,
+ ...(typeof row.turn_orchestration_json === 'string'
+ ? {
+ turnOrchestration: JSON.parse(row.turn_orchestration_json) as NonNullable<
+ PendingMessageAdmission['turnOrchestration']
+ >,
+ }
+ : {}),
admittedAt: row.admitted_at,
});
}
@@ -1574,7 +1582,8 @@ export class SqliteSessionMetadataStore {
.prepare(
`
SELECT turn_id, run_id, message_id, content_json, submitted_content_digest,
- submitted_placement, placement, disposition, queue_order, admitted_at
+ submitted_placement, placement, disposition, queue_order, admitted_at,
+ turn_orchestration_json
FROM message_admissions
WHERE session_id = ? AND message_id = ?
`,
@@ -1612,8 +1621,9 @@ export class SqliteSessionMetadataStore {
`
INSERT INTO message_admissions(
session_id, turn_id, run_id, message_id, content_json, submitted_content_digest,
- submitted_placement, placement, disposition, queue_order, admitted_at
- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
+ submitted_placement, placement, disposition, queue_order, admitted_at,
+ turn_orchestration_json
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
`,
)
.run(
@@ -1628,6 +1638,7 @@ export class SqliteSessionMetadataStore {
stored.disposition,
orderRow.next_order,
stored.admittedAt,
+ stored.turnOrchestration ? JSON.stringify(stored.turnOrchestration) : null,
);
return stored;
@@ -1646,7 +1657,8 @@ export class SqliteSessionMetadataStore {
.prepare(
`
SELECT turn_id, run_id, message_id, content_json, submitted_content_digest,
- submitted_placement, placement, disposition, queue_order, admitted_at
+ submitted_placement, placement, disposition, queue_order, admitted_at,
+ turn_orchestration_json
FROM message_admissions
WHERE session_id = ? AND message_id = ?
`,
@@ -1678,7 +1690,8 @@ export class SqliteSessionMetadataStore {
.prepare(
`
SELECT turn_id, run_id, message_id, content_json, submitted_content_digest,
- submitted_placement, placement, disposition, queue_order, admitted_at
+ submitted_placement, placement, disposition, queue_order, admitted_at,
+ turn_orchestration_json
FROM message_admissions
WHERE session_id = ?
ORDER BY queue_order, sequence
@@ -1718,7 +1731,8 @@ export class SqliteSessionMetadataStore {
.prepare(
`
SELECT turn_id, run_id, message_id, content_json, submitted_content_digest,
- submitted_placement, placement, disposition, queue_order, admitted_at
+ submitted_placement, placement, disposition, queue_order, admitted_at,
+ turn_orchestration_json
FROM message_admissions
WHERE session_id = ? AND message_id = ?
`,
@@ -1827,7 +1841,8 @@ export class SqliteSessionMetadataStore {
.prepare(
`
SELECT turn_id, run_id, message_id, content_json, submitted_content_digest,
- submitted_placement, placement, disposition, queue_order, admitted_at
+ submitted_placement, placement, disposition, queue_order, admitted_at,
+ turn_orchestration_json
FROM message_admissions
WHERE session_id = ? AND message_id = ?
`,
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org