@@ -21,7 +21,7 @@ import { AgentSubscriptionManager, type IAgentSubscription } from '../common/sta
2121import { agentHostAuthority , fromAgentHostUri , toAgentHostUri } from '../common/agentHostUri.js' ;
2222import type { IClientNotificationMap , ICommandMap } from '../common/state/protocol/messages.js' ;
2323import type { IActionEnvelope , INotification , ISessionAction , ITerminalAction } from '../common/state/sessionActions.js' ;
24- import { ISessionSummary , ROOT_STATE_URI , StateComponents , type IRootState , type ISessionState } from '../common/state/sessionState.js' ;
24+ import { ISessionSummary , ROOT_STATE_URI , StateComponents , type IRootState } from '../common/state/sessionState.js' ;
2525import { PROTOCOL_VERSION } from '../common/state/sessionCapabilities.js' ;
2626import { isJsonRpcNotification , isJsonRpcRequest , isJsonRpcResponse , type IJsonRpcResponse , type IProtocolMessage , type IStateSnapshot } from '../common/state/sessionProtocol.js' ;
2727import { isClientTransport , type IProtocolTransport } from '../common/state/sessionTransport.js' ;
@@ -182,33 +182,16 @@ export class RemoteAgentHostProtocolClient extends Disposable implements IAgentC
182182 async createSession ( config ?: IAgentCreateSessionConfig ) : Promise < URI > {
183183 const provider = config ?. provider ?? 'copilot' ;
184184 const session = AgentSession . uri ( provider , generateUuid ( ) ) ;
185- const fork = this . _toProtocolFork ( config ?. fork ) ;
186185 await this . _sendRequest ( 'createSession' , {
187186 session : session . toString ( ) ,
188187 provider,
189188 model : config ?. model ,
190189 workingDirectory : config ?. workingDirectory ? fromAgentHostUri ( config . workingDirectory ) . toString ( ) : undefined ,
191- fork,
192190 config : config ?. config ,
193191 } ) ;
194192 return session ;
195193 }
196194
197- private _toProtocolFork ( fork : IAgentCreateSessionConfig [ 'fork' ] ) : { readonly session : string ; readonly turnId : string } | undefined {
198- if ( ! fork ) {
199- return undefined ;
200- }
201- const sourceState = this . getSubscriptionUnmanaged < ISessionState > ( StateComponents . Session , fork . session ) ?. value ;
202- 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- }
209- return { session : fork . session . toString ( ) , turnId } ;
210- }
211-
212195 async resolveSessionConfig ( params : IAgentResolveSessionConfigParams ) : Promise < IResolveSessionConfigResult > {
213196 return this . _sendRequest ( 'resolveSessionConfig' , {
214197 provider : params . provider ,
0 commit comments