(input: ReloadSessionInput)
| 144 | } |
| 145 | |
| 146 | async reloadSession(input: ReloadSessionInput): Promise<Session> { |
| 147 | const id = normalizeSessionId(input.id); |
| 148 | const active = this.activeSessions.get(id); |
| 149 | if (active !== undefined) { |
| 150 | await active.reloadSession({ |
| 151 | forcePluginSessionStartReminder: input.forcePluginSessionStartReminder, |
| 152 | }); |
| 153 | this.trackSessionEvent(active.id, 'session_reload'); |
| 154 | return active; |
| 155 | } |
| 156 | |
| 157 | const summary = await this.rpc.reloadSession({ |
| 158 | sessionId: id, |
| 159 | forcePluginSessionStartReminder: input.forcePluginSessionStartReminder, |
| 160 | }); |
| 161 | const session = new Session({ |
| 162 | id: summary.id, |
| 163 | workDir: summary.workDir, |
| 164 | summary, |
| 165 | rpc: this.rpc, |
| 166 | onClose: () => { |
| 167 | this.activeSessions.delete(summary.id); |
| 168 | }, |
| 169 | }); |
| 170 | this.activeSessions.set(session.id, session); |
| 171 | this.trackSessionStarted(summary.id, true); |
| 172 | this.trackSessionEvent(session.id, 'session_reload'); |
| 173 | return session; |
| 174 | } |
| 175 | |
| 176 | async forkSession(input: ForkSessionInput): Promise<Session> { |
| 177 | const summary = await this.rpc.forkSession({ |
nothing calls this directly
no test coverage detected