(workspaceId: string)
| 2743 | } |
| 2744 | |
| 2745 | public getOrCreateSession(workspaceId: string): AgentSession { |
| 2746 | assert(typeof workspaceId === "string", "workspaceId must be a string"); |
| 2747 | const trimmed = workspaceId.trim(); |
| 2748 | assert(trimmed.length > 0, "workspaceId must not be empty"); |
| 2749 | |
| 2750 | let session = this.sessions.get(trimmed); |
| 2751 | if (session) { |
| 2752 | return session; |
| 2753 | } |
| 2754 | |
| 2755 | session = this.transientStartupRecoverySessions.get(trimmed); |
| 2756 | if (session) { |
| 2757 | this.transientStartupRecoverySessions.delete(trimmed); |
| 2758 | this.sessions.set(trimmed, session); |
| 2759 | this.attachSessionSubscriptions(trimmed, session); |
| 2760 | return session; |
| 2761 | } |
| 2762 | |
| 2763 | session = this.createSession(trimmed); |
| 2764 | this.sessions.set(trimmed, session); |
| 2765 | this.attachSessionSubscriptions(trimmed, session); |
| 2766 | |
| 2767 | return session; |
| 2768 | } |
| 2769 | |
| 2770 | async waitForWorkspaceIdle( |
| 2771 | workspaceId: string, |
no test coverage detected