feat(tess): wire durable interaction surfaces

This commit is contained in:
2026-07-13 04:43:22 -05:00
parent 84d884b932
commit 451f7e04ec
16 changed files with 782 additions and 58 deletions
+5 -5
View File
@@ -256,9 +256,11 @@ export class InMemoryDurableSessionStore implements DurableSessionStore {
async create(identity: DurableSessionIdentity): Promise<void> {
const existing = this.sessions.get(identity.sessionId);
if (existing) {
if (!identitiesEqual(existing.identity, identity)) {
if (!sameEnrollmentScope(existing.identity, identity)) {
throw new Error(`Durable Tess session identity conflict: ${identity.sessionId}`);
}
existing.identity.providerId = identity.providerId;
existing.identity.runtimeSessionId = identity.runtimeSessionId;
return;
}
this.sessions.set(identity.sessionId, {
@@ -416,14 +418,12 @@ export class InMemoryDurableSessionStore implements DurableSessionStore {
}
}
function identitiesEqual(left: DurableSessionIdentity, right: DurableSessionIdentity): boolean {
function sameEnrollmentScope(left: DurableSessionIdentity, right: DurableSessionIdentity): boolean {
return (
left.agentName === right.agentName &&
left.sessionId === right.sessionId &&
left.tenantId === right.tenantId &&
left.ownerId === right.ownerId &&
left.providerId === right.providerId &&
left.runtimeSessionId === right.runtimeSessionId
left.ownerId === right.ownerId
);
}