test(cross-version): register the turn-completion subscribe on the wire manifest

The cross-version gate asserts the structured surface's method list by name and
count, so an additive method has to be declared there deliberately. Adding the
entry makes the suite call it in both skew directions and stubs the host side,
which is the statement the gate exists to force.
This commit is contained in:
Brennan Benson
2026-09-20 23:57:43 -07:00
parent a9882c03bd
commit db6ea5cb66
2 changed files with 11 additions and 0 deletions
@@ -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()
}
}
@@ -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 } }