@@ -148,7 +148,9 @@ describe('AgentTool', () => {
148148
149149 describe ( 'agentSessionSubagentEnabled feature flag' , ( ) => {
150150 it ( 'should use LocalSessionInvocation when flag is enabled for local agent' , async ( ) => {
151- vi . spyOn ( mockConfig , 'isAgentSessionEnabled' ) . mockReturnValue ( true ) ;
151+ vi . spyOn ( mockConfig , 'isAgentSessionSubagentEnabled' ) . mockReturnValue (
152+ true ,
153+ ) ;
152154 tool = new AgentTool ( mockConfig , mockMessageBus ) ;
153155
154156 const params = {
@@ -169,7 +171,9 @@ describe('AgentTool', () => {
169171 } ) ;
170172
171173 it ( 'should use RemoteSessionInvocation when flag is enabled for remote agent' , async ( ) => {
172- vi . spyOn ( mockConfig , 'isAgentSessionEnabled' ) . mockReturnValue ( true ) ;
174+ vi . spyOn ( mockConfig , 'isAgentSessionSubagentEnabled' ) . mockReturnValue (
175+ true ,
176+ ) ;
173177 tool = new AgentTool ( mockConfig , mockMessageBus ) ;
174178
175179 const params = {
@@ -190,7 +194,9 @@ describe('AgentTool', () => {
190194 } ) ;
191195
192196 it ( 'should use legacy invocations when flag is disabled (default)' , async ( ) => {
193- vi . spyOn ( mockConfig , 'isAgentSessionEnabled' ) . mockReturnValue ( false ) ;
197+ vi . spyOn ( mockConfig , 'isAgentSessionSubagentEnabled' ) . mockReturnValue (
198+ false ,
199+ ) ;
194200 tool = new AgentTool ( mockConfig , mockMessageBus ) ;
195201
196202 const localParams = {
@@ -217,7 +223,9 @@ describe('AgentTool', () => {
217223 } ) ;
218224
219225 it ( 'should thread onAgentEvent to session invocations' , async ( ) => {
220- vi . spyOn ( mockConfig , 'isAgentSessionEnabled' ) . mockReturnValue ( true ) ;
226+ vi . spyOn ( mockConfig , 'isAgentSessionSubagentEnabled' ) . mockReturnValue (
227+ true ,
228+ ) ;
221229 const onEvent = vi . fn ( ) ;
222230 tool = new AgentTool ( mockConfig , mockMessageBus , onEvent ) ;
223231
@@ -238,7 +246,9 @@ describe('AgentTool', () => {
238246 } ) ;
239247
240248 it ( 'should always use BrowserAgentInvocation for browser agent regardless of flag' , async ( ) => {
241- vi . spyOn ( mockConfig , 'isAgentSessionEnabled' ) . mockReturnValue ( true ) ;
249+ vi . spyOn ( mockConfig , 'isAgentSessionSubagentEnabled' ) . mockReturnValue (
250+ true ,
251+ ) ;
242252 tool = new AgentTool ( mockConfig , mockMessageBus ) ;
243253
244254 const params = {
0 commit comments