We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f47496b commit d4f79a2Copy full SHA for d4f79a2
1 file changed
src/vs/platform/agentHost/electron-browser/remoteAgentHostProtocolClient.ts
@@ -199,7 +199,10 @@ export class RemoteAgentHostProtocolClient extends Disposable implements IAgentC
199
return undefined;
200
}
201
const sourceState = this.getSubscriptionUnmanaged<ISessionState>(StateComponents.Session, fork.session)?.value;
202
- const turnId = sourceState?.turns[fork.turnIndex]?.id;
+ if (!sourceState || sourceState instanceof Error) {
203
+ throw new Error(`Cannot fork: protocol state for ${fork.session.toString()} is not available`);
204
+ }
205
+ const turnId = sourceState.turns[fork.turnIndex]?.id;
206
if (!turnId) {
207
throw new Error(`Cannot fork: turn index ${fork.turnIndex} not found in protocol state for ${fork.session.toString()}`);
208
0 commit comments