mirror of
https://github.com/stablyai/orca.git
synced 2026-09-21 16:02:20 +00:00
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:
@@ -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 } }
|
||||
|
||||
Reference in New Issue
Block a user