feat(tess): wire durable interaction surfaces (#732)
Some checks failed
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/push/publish Pipeline was canceled

This commit was merged in pull request #732.
This commit is contained in:
2026-07-13 10:05:29 +00:00
parent 84d884b932
commit 0b621660c8
16 changed files with 782 additions and 58 deletions

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
);
}