Add Cursor SDK orchestration replay support
- Wire Cursor adapter and provider session handling into orchestration v2 - Add replay fixtures, recording script, and coverage for Cursor turn flows - Update docs and debug timeline mapping for Cursor events
This commit is contained in:
1 parent
4fae73ee08
commit
ce64e37094
50 files changed
+7163
-201
No files matched your search
@@ -403,6 +403,48 @@ function makePendingRuntimeRequestEvents(input: {
|
||||
});
|
||||
}
|
||||
|
||||
it.effect("ProviderSessionManagerV2 releases live sessions when its layer shuts down", () =>
|
||||
Effect.gen(function* () {
|
||||
const state = yield* Ref.make(emptyState);
|
||||
const effect = Effect.gen(function* () {
|
||||
const eventSink = yield* EventSinkV2;
|
||||
const idAllocator = yield* IdAllocatorV2;
|
||||
const manager = yield* ProviderSessionManagerV2;
|
||||
const now = yield* DateTime.now;
|
||||
const threadId = ThreadId.make("thread-provider-session-manager-shutdown");
|
||||
const providerSessionId = yield* idAllocator.allocate.providerSession({
|
||||
provider: "codex",
|
||||
threadId,
|
||||
});
|
||||
|
||||
yield* eventSink.write({
|
||||
events: [yield* makeThreadCreatedEvent({ idAllocator, threadId, now })],
|
||||
});
|
||||
yield* manager.open({
|
||||
threadId,
|
||||
providerSessionId,
|
||||
modelSelection,
|
||||
runtimePolicy,
|
||||
});
|
||||
|
||||
const liveState = yield* Ref.get(state);
|
||||
assert.equal(liveState.openCount, 1);
|
||||
assert.equal(liveState.closeCount, 0);
|
||||
});
|
||||
|
||||
yield* effect.pipe(
|
||||
Effect.provide(
|
||||
makeTestLayer({
|
||||
state,
|
||||
idleTimeoutMs: 60_000,
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
assert.equal((yield* Ref.get(state)).closeCount, 1);
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect(
|
||||
"ProviderSessionManagerV2 issues MCP credentials before opening and revokes them on close",
|
||||
() =>
|
||||
|
||||
Reference in new issue
Block a user