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/25 09:59:12 UTC
(maka) branch fix/durable-message-lifecycle created (now 19de5eb7c)
This is an automated email from the ASF dual-hosted git repository.
Astro-Han pushed a change to branch fix/durable-message-lifecycle
in repository https://gitbox.apache.org/repos/asf/maka.git
at 19de5eb7c refactor(runtime-host): make queued messages session-owned
This branch includes the following new commits:
new 300270c8c fix(runtime-host): recover only pending messages
new 19de5eb7c refactor(runtime-host): make queued messages session-owned
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
(maka) 02/02: refactor(runtime-host): make queued messages session-owned
Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
Astro-Han pushed a commit to branch fix/durable-message-lifecycle
in repository https://gitbox.apache.org/repos/asf/maka.git
commit 19de5eb7ca13c6fb27f5c4598df5d9c55019604d
Author: AstroHan <le...@outlook.com>
AuthorDate: Tue Aug 25 17:58:55 2026 +0800
refactor(runtime-host): make queued messages session-owned
Generated-by: Codex
---
.../src/__tests__/execution-host-queue.test.ts | 35 +++++++---
.../src/__tests__/message-coordinator.test.ts | 33 ++--------
.../src/__tests__/root-turn-coordinator.test.ts | 77 +++++++++++-----------
.../src/server/client-capability-coordinator.ts | 6 +-
.../runtime-host/src/server/message-coordinator.ts | 24 +------
.../src/server/root-turn-coordinator.ts | 15 ++---
6 files changed, 77 insertions(+), 113 deletions(-)
diff --git a/packages/runtime-host/src/__tests__/execution-host-queue.test.ts b/packages/runtime-host/src/__tests__/execution-host-queue.test.ts
index bfd74e9d1..9e7eb553d 100644
--- a/packages/runtime-host/src/__tests__/execution-host-queue.test.ts
+++ b/packages/runtime-host/src/__tests__/execution-host-queue.test.ts
@@ -156,22 +156,33 @@ test('subscribed Clients share one canonical queue and ordered root handoff', as
}
}
- const followupId = randomUUID();
- const followupContent = { text: 'continue after the first root completes' };
- const queued = await tui.request('turn.message.submit', {
+ const desktopFollowupId = randomUUID();
+ const desktopFollowupContent = { text: 'continue from the desktop' };
+ const desktopQueued = await desktop.request('turn.message.submit', {
originHostEpoch: host.hostEpoch,
sessionId: fixture.sessionId,
- messageId: followupId,
- content: followupContent,
+ messageId: desktopFollowupId,
+ content: desktopFollowupContent,
placement: 'next_turn',
});
- assert.equal(queued.disposition, 'followup');
+ assert.equal(desktopQueued.disposition, 'followup');
+ const tuiFollowupId = randomUUID();
+ const tuiFollowupContent = { text: 'continue from the terminal' };
+ const tuiQueued = await tui.request('turn.message.submit', {
+ originHostEpoch: host.hostEpoch,
+ sessionId: fixture.sessionId,
+ messageId: tuiFollowupId,
+ content: tuiFollowupContent,
+ placement: 'next_turn',
+ });
+ assert.equal(tuiQueued.disposition, 'followup');
for (const probe of [desktopProbe, tuiProbe]) {
const queueProjection = await probe.waitFor(
(frame) =>
frame.kind === 'subscription.session_projection' &&
- frame.snapshot.queue.followup.some((entry) => entry.messageId === followupId),
- 'continuity did not publish the accepted follow-up',
+ frame.snapshot.queue.followup.some((entry) => entry.messageId === desktopFollowupId) &&
+ frame.snapshot.queue.followup.some((entry) => entry.messageId === tuiFollowupId),
+ 'continuity did not publish both accepted follow-ups',
);
assert.equal(queueProjection.kind, 'subscription.session_projection');
}
@@ -210,7 +221,13 @@ test('subscribed Clients share one canonical queue and ordered root handoff', as
chain.map((admission) => admission.turnId),
[firstTurnId, successor.snapshot.rootTurn.turnId],
);
- assert.deepEqual(chain[1]?.normalizedInput, followupContent);
+ assert.deepEqual(
+ chain[1]?.sourceMessages.map((source) => source.messageId),
+ [desktopFollowupId, tuiFollowupId],
+ );
+ assert.deepEqual(chain[1]?.normalizedInput, {
+ text: `${desktopFollowupContent.text}\n\n${tuiFollowupContent.text}`,
+ });
});
});
diff --git a/packages/runtime-host/src/__tests__/message-coordinator.test.ts b/packages/runtime-host/src/__tests__/message-coordinator.test.ts
index 3f1b23bc8..4763c1267 100644
--- a/packages/runtime-host/src/__tests__/message-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/message-coordinator.test.ts
@@ -187,7 +187,7 @@ test('invalidates the canonical projection after each observable queue mutation'
await fixture.coordinator.close();
});
-test('partitions a mixed-Client follow-up queue across root handoffs', async () => {
+test('hands a mixed-Client queue to one Session successor', async () => {
const fixture = createFixture();
fixture.coordinator.reserveRootTurn(ROOT);
const owner = fixture.coordinator.bindRun(ROOT);
@@ -214,49 +214,26 @@ test('partitions a mixed-Client follow-up queue across root handoffs', async ()
const batch = fixture.coordinator.beginTerminalTransition(ROOT);
assert.deepEqual(
batch.sources.map((source) => source.messageId),
- ['steering-from-b'],
+ ['steering-from-b', 'followup-from-c'],
);
- assert.equal(batch.initiatingConnectionId, 'connection-b');
fixture.coordinator.commitNextRoot(batch, {
sessionId: ROOT.sessionId,
turnId: 'turn-2',
runId: 'run-2',
});
- assert.equal(fixture.liveResidencies(), 1);
+ assert.equal(fixture.liveResidencies(), 0);
const nextOwner = fixture.coordinator.bindRun({
sessionId: ROOT.sessionId,
turnId: 'turn-2',
runId: 'run-2',
});
nextOwner.release();
- const secondBatch = fixture.coordinator.beginTerminalTransition({
- sessionId: ROOT.sessionId,
- turnId: 'turn-2',
- runId: 'run-2',
- });
- assert.deepEqual(
- secondBatch.sources.map((source) => source.messageId),
- ['followup-from-c'],
- );
- assert.equal(secondBatch.initiatingConnectionId, 'connection-c');
- fixture.coordinator.commitNextRoot(secondBatch, {
- sessionId: ROOT.sessionId,
- turnId: 'turn-3',
- runId: 'run-3',
- });
- assert.equal(fixture.liveResidencies(), 0);
- const finalOwner = fixture.coordinator.bindRun({
- sessionId: ROOT.sessionId,
- turnId: 'turn-3',
- runId: 'run-3',
- });
- finalOwner.release();
fixture.coordinator.completeIdle(
fixture.coordinator.beginTerminalTransition({
sessionId: ROOT.sessionId,
- turnId: 'turn-3',
- runId: 'run-3',
+ turnId: 'turn-2',
+ runId: 'run-2',
}),
);
await fixture.coordinator.close();
diff --git a/packages/runtime-host/src/__tests__/root-turn-coordinator.test.ts b/packages/runtime-host/src/__tests__/root-turn-coordinator.test.ts
index 9d9d5b0c9..b809eb07a 100644
--- a/packages/runtime-host/src/__tests__/root-turn-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/root-turn-coordinator.test.ts
@@ -70,6 +70,7 @@ import { HostArtifactCoordinator } from '../server/artifact-coordinator.js';
import { HostCanonicalPermissionOutcomeReader } from '../server/canonical-permission-outcome-reader.js';
import { CanonicalSessionProjectionReader } from '../server/canonical-session-projection.js';
import { HostClientCapabilityCoordinator } from '../server/client-capability-coordinator.js';
+import { ClientCapabilityInvocationError } from '../server/client-capability-invocation-broker.js';
import { HostContextCoordinator } from '../server/context-coordinator.js';
import type { RuntimeHostResidency } from '../server/host-kernel.js';
import type { HostedExecutionObserver } from '../server/hosted-execution-authority.js';
@@ -3277,7 +3278,7 @@ test('an exact active retry preserves the Client Capability admission binding',
}
});
-test('mixed-Client queued follow-ups preserve each submitting connection through root handoff', {
+test('mixed-Client queued follow-ups use one Session successor without connection-local tools', {
timeout: 20_000,
}, async () => {
const clientCapabilities = new HostClientCapabilityCoordinator({
@@ -3382,22 +3383,11 @@ test('mixed-Client queued follow-ups preserve each submitting connection through
const firstFollowup = fixture.coordinator.readRootState(fixture.sessionId);
assert.equal(firstFollowup.kind, 'active');
if (firstFollowup.kind !== 'active') return;
- const firstFollowupSnapshot = clientCapabilities.snapshotForSession(fixture.sessionId);
- assert.deepEqual(firstFollowupSnapshot?.registrationIds, ['registration-b']);
- firstFollowupSnapshot?.release();
+ const followupSnapshot = clientCapabilities.snapshotForSession(fixture.sessionId);
+ assert.equal(followupSnapshot, undefined);
await waitUntil(() => backend?.sendCount === 2);
backend?.release();
- await waitUntil(() => {
- const state = fixture.coordinator.readRootState(fixture.sessionId);
- return state.kind === 'active' && state.turnId !== firstFollowup.turnId;
- });
- const secondFollowupSnapshot = clientCapabilities.snapshotForSession(fixture.sessionId);
- assert.deepEqual(secondFollowupSnapshot?.registrationIds, ['registration-a']);
- secondFollowupSnapshot?.release();
-
- await waitUntil(() => backend?.sendCount === 3);
- backend?.release();
await waitUntil(
() => fixture.coordinator.readRootState(fixture.sessionId).kind === 'idle',
5_000,
@@ -3407,7 +3397,7 @@ test('mixed-Client queued follow-ups preserve each submitting connection through
);
assert.deepEqual(
admissions.map((admission) => admission.sourceMessages.map((source) => source.messageId)),
- [[], ['followup-from-provider-b'], ['followup-from-provider-a']],
+ [[], ['followup-from-provider-b', 'followup-from-provider-a']],
);
} finally {
first.close();
@@ -3417,14 +3407,16 @@ test('mixed-Client queued follow-ups preserve each submitting connection through
}
});
-test('queued follow-up degrades lost Session tools and rebinds ephemeral tools to its Client', {
+test('queued follow-up does not bind lost or ambiguous connection-local tools', {
timeout: 20_000,
}, async () => {
- await assertFollowupCapabilityRebinding('call');
- await assertFollowupCapabilityRebinding('turn');
+ await assertSessionSuccessorCapabilityDegradation('call');
+ await assertSessionSuccessorCapabilityDegradation('turn');
});
-async function assertFollowupCapabilityRebinding(affinity: 'call' | 'turn'): Promise<void> {
+async function assertSessionSuccessorCapabilityDegradation(
+ affinity: 'call' | 'turn',
+): Promise<void> {
const clientCapabilities = new HostClientCapabilityCoordinator({
activation: new RuntimePolicyActivationGate(),
onModelToolsChanged: () => undefined,
@@ -3567,26 +3559,33 @@ async function assertFollowupCapabilityRebinding(affinity: 'call' | 'turn'): Pro
return state.kind === 'active' && state.turnId !== firstTurnId;
});
const snapshot = clientCapabilities.snapshotForSession(fixture.sessionId);
- assert.ok(snapshot);
- assert.equal(
- snapshot.tools.some((tool) => tool.name.endsWith('navigate_session')),
- false,
- );
- const ephemeral = snapshot.tools.find((tool) => tool.name.endsWith('navigate_ephemeral'));
- assert.ok(ephemeral);
- await ephemeral.impl(
- {},
- {
- sessionId: fixture.sessionId,
- turnId: 'followup-turn',
- cwd: '/tmp',
- toolCallId: `followup-${affinity}`,
- abortSignal: new AbortController().signal,
- emitOutput: () => undefined,
- },
- );
- assert.deepEqual(calls, ['provider-followup']);
- snapshot.release();
+ if (affinity === 'turn') {
+ assert.equal(snapshot, undefined);
+ } else {
+ assert.ok(snapshot);
+ const ephemeral = snapshot.tools.find((tool) => tool.name.endsWith('navigate_ephemeral'));
+ assert.ok(ephemeral);
+ await assert.rejects(
+ () =>
+ Promise.resolve(
+ ephemeral.impl(
+ {},
+ {
+ sessionId: fixture.sessionId,
+ turnId: 'followup-turn',
+ cwd: '/tmp',
+ toolCallId: `followup-${affinity}`,
+ abortSignal: new AbortController().signal,
+ emitOutput: () => undefined,
+ },
+ ),
+ ),
+ (error: unknown) =>
+ error instanceof ClientCapabilityInvocationError && error.code === 'capability_ambiguous',
+ );
+ snapshot.release();
+ }
+ assert.deepEqual(calls, []);
await waitUntil(() => backend?.sendCount === 2);
backend?.release();
diff --git a/packages/runtime-host/src/server/client-capability-coordinator.ts b/packages/runtime-host/src/server/client-capability-coordinator.ts
index 5249e1d45..1e54236d9 100644
--- a/packages/runtime-host/src/server/client-capability-coordinator.ts
+++ b/packages/runtime-host/src/server/client-capability-coordinator.ts
@@ -235,10 +235,10 @@ export class HostClientCapabilityCoordinator implements ClientCapabilityService
return this.#bindSession(sessionId, initiatingConnectionId, 'strict');
}
- async bindConfirmedFollowup(sessionId: string, initiatingConnectionId: string): Promise<void> {
- const result = await this.#bindSession(sessionId, initiatingConnectionId, 'degrade');
+ async bindSessionSuccessor(sessionId: string): Promise<void> {
+ const result = await this.#bindSession(sessionId, '', 'degrade');
if (!result.ok) {
- throw new Error(`Confirmed follow-up capability binding failed: ${result.message}`);
+ throw new Error(`Session successor capability binding failed: ${result.message}`);
}
}
diff --git a/packages/runtime-host/src/server/message-coordinator.ts b/packages/runtime-host/src/server/message-coordinator.ts
index b3d40e4c2..066d3d5e0 100644
--- a/packages/runtime-host/src/server/message-coordinator.ts
+++ b/packages/runtime-host/src/server/message-coordinator.ts
@@ -120,7 +120,6 @@ export interface HostMessagePreparationInput {
readonly turnId: string;
readonly content: MessageContent;
readonly placement: MessagePlacement;
- readonly initiatingConnectionId: string;
}
export interface HostMessageStopClaim {
@@ -206,7 +205,6 @@ interface LiveEntry {
content: MessageContent;
modelContent: MessageContent;
submittedContentDigest: `sha256:${string}`;
- readonly initiatingConnectionId: string;
readonly placement: MessagePlacement;
readonly disposition: 'steering' | 'followup';
readonly generation: number;
@@ -294,7 +292,6 @@ export interface RootFollowupBatch {
readonly transitionId: string;
readonly sessionId: string;
readonly previousTurnId: string;
- readonly initiatingConnectionId: string | undefined;
readonly content: MessageContent;
readonly submittedContent: MessageContent;
readonly sources: readonly RootFollowupSource[];
@@ -477,7 +474,7 @@ export class HostMessageCoordinator implements RuntimeMessageAuthority {
this.#mutated(state);
}
state.run = undefined;
- const entries = sameInitiatingClientPrefix(state.followup);
+ const entries = [...state.followup];
const followup = canonicalFollowupBatch(entries);
const transition: TerminalTransition = {
transitionId: this.#createId(),
@@ -489,7 +486,6 @@ export class HostMessageCoordinator implements RuntimeMessageAuthority {
transitionId: transition.transitionId,
sessionId: identity.sessionId,
previousTurnId: identity.turnId,
- initiatingConnectionId: entries[0]?.initiatingConnectionId,
content: followup.content,
submittedContent: followup.submittedContent,
sources: followup.sources,
@@ -533,7 +529,6 @@ export class HostMessageCoordinator implements RuntimeMessageAuthority {
sessionId: string;
turnId: string;
runId: string;
- previousRootTurnId: string | null;
messageIds: readonly string[];
}): Promise<void> {
const handoff: string[] = [];
@@ -698,7 +693,6 @@ export class HostMessageCoordinator implements RuntimeMessageAuthority {
content: submittedProjectionContent(admission.content),
modelContent: admission.content,
submittedContentDigest: admission.submittedContentDigest,
- initiatingConnectionId: '',
placement: admission.placement,
disposition: admission.disposition,
generation: state.generation,
@@ -897,7 +891,6 @@ export class HostMessageCoordinator implements RuntimeMessageAuthority {
turnId: rootState.turnId,
content: payload.content,
placement: input.placement,
- initiatingConnectionId,
});
if (prepared.kind === 'rejected') {
return failure('operation_conflict', prepared.error);
@@ -992,7 +985,6 @@ export class HostMessageCoordinator implements RuntimeMessageAuthority {
content: payload.content,
modelContent: prepared.content,
submittedContentDigest: messageAdmission.submittedContentDigest,
- initiatingConnectionId,
placement: input.placement,
disposition,
generation: state.generation,
@@ -1329,7 +1321,6 @@ export class HostMessageCoordinator implements RuntimeMessageAuthority {
turnId: state.reservedRoot.turnId,
content,
placement: queued.entry.placement,
- initiatingConnectionId: queued.entry.initiatingConnectionId,
});
if (prepared.kind === 'rejected') return failure('operation_conflict', prepared.error);
const modelContent = prepared.content;
@@ -1875,7 +1866,6 @@ export class HostMessageCoordinator implements RuntimeMessageAuthority {
!transition ||
transition.transitionId !== batch.transitionId ||
transition.identity.turnId !== batch.previousTurnId ||
- transition.entries[0]?.initiatingConnectionId !== batch.initiatingConnectionId ||
!isDeepStrictEqual(transition.entries.map(sourceFromEntry), batch.sources) ||
!messageContentsEqual(
aggregateMessageContent(transition.entries.map((entry) => entry.modelContent)),
@@ -2269,18 +2259,6 @@ function canonicalFollowupBatch(entries: readonly LiveEntry[]): {
}
}
-function sameInitiatingClientPrefix(entries: readonly LiveEntry[]): LiveEntry[] {
- const initiatingConnectionId = entries[0]?.initiatingConnectionId;
- if (!initiatingConnectionId) {
- const boundary = entries.findIndex((entry) => entry.initiatingConnectionId !== '');
- return entries.slice(0, boundary === -1 ? entries.length : boundary);
- }
- const boundary = entries.findIndex(
- (entry) => entry.initiatingConnectionId !== initiatingConnectionId,
- );
- return entries.slice(0, boundary === -1 ? entries.length : boundary);
-}
-
function rootAdmissionPayloadFits(sources: readonly RootTurnSourceMessage[]): boolean {
try {
const content = aggregateMessageContent(sources.map((source) => source.content));
diff --git a/packages/runtime-host/src/server/root-turn-coordinator.ts b/packages/runtime-host/src/server/root-turn-coordinator.ts
index 00200b0ed..51af33784 100644
--- a/packages/runtime-host/src/server/root-turn-coordinator.ts
+++ b/packages/runtime-host/src/server/root-turn-coordinator.ts
@@ -410,7 +410,6 @@ export class RootTurnCoordinator implements HostedExecutionAuthority {
sessionId,
turnId: admission.turnId,
runId: admission.runId,
- previousRootTurnId: admission.previousRootTurnId,
messageIds: admission.sourceMessages.map((source) => source.messageId),
});
return this.prepareAdmittedTurn(
@@ -1084,7 +1083,6 @@ export class RootTurnCoordinator implements HostedExecutionAuthority {
sessionId: input.sessionId,
turnId,
runId,
- previousRootTurnId: admitted.admission.previousRootTurnId,
messageIds: [input.sourceMessage.messageId],
});
const disposition = await this.prepareAdmittedTurn(
@@ -1147,7 +1145,6 @@ export class RootTurnCoordinator implements HostedExecutionAuthority {
sessionId: input.sessionId,
turnId,
runId: admitted.admission.runId,
- previousRootTurnId: admitted.admission.previousRootTurnId,
messageIds: input.sources.map((source) => source.messageId),
});
const disposition = await this.prepareAdmittedTurn(
@@ -1186,7 +1183,7 @@ export class RootTurnCoordinator implements HostedExecutionAuthority {
if (input.placement === 'current_turn') return prepare();
const preview = await this.previewCapabilityBinding(
input.sessionId,
- input.initiatingConnectionId,
+ '',
prepare,
);
return preview.ok ? preview.value : { kind: 'rejected', error: preview.message };
@@ -2392,13 +2389,10 @@ export class RootTurnCoordinator implements HostedExecutionAuthority {
previous: ActiveRootTurn,
admissionLease: SessionAdmissionLease,
): Promise<void> {
- const initiatingConnectionId = batch.initiatingConnectionId;
// A confirmed follow-up must become a durable root even when a Session
- // provider is unavailable. Lost tools are omitted while ephemeral
- // capabilities bind to the Client that submitted this follow-up.
- if (initiatingConnectionId) {
- await this.clientCapabilities?.bindConfirmedFollowup(batch.sessionId, initiatingConnectionId);
- }
+ // provider is unavailable. Lost and ambiguous connection-local tools are
+ // omitted because a queued Message belongs to the durable Session.
+ await this.clientCapabilities?.bindSessionSuccessor(batch.sessionId);
const turnId = randomUUID();
const header = await this.stores.sessionStore.readHeaderSnapshot(batch.sessionId);
@@ -2425,7 +2419,6 @@ export class RootTurnCoordinator implements HostedExecutionAuthority {
sessionId: batch.sessionId,
turnId,
runId: admitted.admission.runId,
- previousRootTurnId: admitted.admission.previousRootTurnId,
messageIds: batch.sources.map((source) => source.messageId),
});
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
(maka) 01/02: fix(runtime-host): recover only pending messages
Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
Astro-Han pushed a commit to branch fix/durable-message-lifecycle
in repository https://gitbox.apache.org/repos/asf/maka.git
commit 300270c8ce82cdbf86d1fd2fda7a150d9f29f169
Author: AstroHan <le...@outlook.com>
AuthorDate: Tue Aug 25 17:58:44 2026 +0800
fix(runtime-host): recover only pending messages
Generated-by: Codex
---
.../src/__tests__/message-coordinator.test.ts | 30 ++++++++++++++++++++++
.../runtime-host/src/server/message-coordinator.ts | 2 +-
2 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/packages/runtime-host/src/__tests__/message-coordinator.test.ts b/packages/runtime-host/src/__tests__/message-coordinator.test.ts
index 30b7dc65f..3f1b23bc8 100644
--- a/packages/runtime-host/src/__tests__/message-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/message-coordinator.test.ts
@@ -335,6 +335,36 @@ test('recovery treats a durable steering event as the handoff proof', async () =
await fixture.coordinator.close();
});
+test('active recovery rebuilds only admissions without a durable proof', async () => {
+ const fixture = createFixture();
+ for (const [messageId, text] of [
+ ['proved-steering', 'already delivered'],
+ ['still-pending', 'deliver after recovery'],
+ ] as const) {
+ await fixture.admissions.commitMessageAdmission({
+ sessionId: ROOT.sessionId,
+ turnId: ROOT.turnId,
+ runId: ROOT.runId,
+ messageId,
+ content: { text },
+ submittedContentDigest: messageContentDigest({ text }),
+ submittedPlacement: 'current_turn',
+ placement: 'current_turn',
+ disposition: 'steering',
+ admittedAt: 1,
+ });
+ }
+ fixture.events.push(steeringEvent('proved-steering', 'already delivered'));
+
+ await fixture.coordinator.recoverPendingAfterHostRestart([ROOT.sessionId]);
+
+ assert.equal(fixture.readMessageAdmission('proved-steering'), undefined);
+ assert.deepEqual(
+ fixture.coordinator.projection(ROOT.sessionId).steering.map((entry) => entry.messageId),
+ ['still-pending'],
+ );
+});
+
test('binds the exact reserved Run after a pre-bind stop fence', async () => {
const fixture = createFixture();
fixture.coordinator.reserveRootTurn(ROOT);
diff --git a/packages/runtime-host/src/server/message-coordinator.ts b/packages/runtime-host/src/server/message-coordinator.ts
index 4524f9cef..b3d40e4c2 100644
--- a/packages/runtime-host/src/server/message-coordinator.ts
+++ b/packages/runtime-host/src/server/message-coordinator.ts
@@ -682,7 +682,7 @@ export class HostMessageCoordinator implements RuntimeMessageAuthority {
const state = this.#requireState(sessionId);
if (!state.reservedRoot) this.reserveRootTurn(rootState);
if (!sameRun(state.reservedRoot!, rootState)) continue;
- for (const admission of admissions) {
+ for (const admission of pending) {
if (admission.turnId !== rootState.turnId || admission.runId !== rootState.runId) continue;
const existing = allLiveEntries(state).find(
(entry) => entry.messageId === admission.messageId,
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org