diff --git a/tests/e2e/cross-version-wire/structured-agent-session-host-fixture.ts b/tests/e2e/cross-version-wire/structured-agent-session-host-fixture.ts index 6cf13ecff24..465899751a2 100644 --- a/tests/e2e/cross-version-wire/structured-agent-session-host-fixture.ts +++ b/tests/e2e/cross-version-wire/structured-agent-session-host-fixture.ts @@ -78,6 +78,9 @@ export function structuredHostStub( subscriber.emit({ type: 'snapshot', sessions: [] }) return () => undefined }), + // No opening emit, unlike the status feed above: a completion is an edge, so this stream + // opens empty and a subscriber that was away has missed what passed. + subscribeTurnCompletions: vi.fn(() => () => undefined), unsubscribe: vi.fn() } } diff --git a/tests/e2e/cross-version-wire/structured-agent-session-surface-manifest.ts b/tests/e2e/cross-version-wire/structured-agent-session-surface-manifest.ts index 0bb0b43f20f..97588ae0cfb 100644 --- a/tests/e2e/cross-version-wire/structured-agent-session-surface-manifest.ts +++ b/tests/e2e/cross-version-wire/structured-agent-session-surface-manifest.ts @@ -18,6 +18,7 @@ export const THREAD = '019fd532-7c11-7a90-b6de-4e1a2c3d5f60' export const NOW = 1_800_000_000_000 export const REWIND_METHOD = 'agentSession.rewind' export const STATUS_FEED_METHOD = 'agentSession.subscribeStatus' +export const TURN_COMPLETION_FEED_METHOD = 'agentSession.subscribeTurnCompletions' let operations = 0 @@ -147,6 +148,13 @@ export const STRUCTURED_CALLS: { hostMethod: 'subscribeStatus', result: { type: 'snapshot', sessions: [] } }, + // Opens with nothing for the same reason `agentSession.subscribe` does, and unlike the status + // feed above: a completion is an edge that has already passed, not state a late subscriber + // needs. Reaching the host is the only signal that the gate opened. + { + method: TURN_COMPLETION_FEED_METHOD, + hostMethod: 'subscribeTurnCompletions' + }, // Teardown runs through the runtime's subscription registry rather than the // host, so its reply is the only signal that the gate opened. { method: 'agentSession.unsubscribe', hostMethod: null, result: { unsubscribed: true } }