@@ -15,6 +15,7 @@ import {
1515 MessageBusType ,
1616 IdeClient ,
1717 CoreToolCallStatus ,
18+ type SerializableConfirmationDetails ,
1819} from '@google/gemini-cli-core' ;
1920import { type IndividualToolCallDisplay } from '../types.js' ;
2021
@@ -182,4 +183,44 @@ describe('ToolActionsContext', () => {
182183
183184 expect ( result . current . isDiffingEnabled ) . toBe ( false ) ;
184185 } ) ;
186+
187+ it ( 'calls local onConfirm for tools without correlationId' , async ( ) => {
188+ const mockOnConfirm = vi . fn ( ) . mockResolvedValue ( undefined ) ;
189+ const legacyTool : IndividualToolCallDisplay = {
190+ callId : 'legacy-call' ,
191+ name : 'legacy-tool' ,
192+ description : 'desc' ,
193+ status : CoreToolCallStatus . AwaitingApproval ,
194+ resultDisplay : undefined ,
195+ confirmationDetails : {
196+ type : 'exec' ,
197+ title : 'exec' ,
198+ command : 'ls' ,
199+ rootCommand : 'ls' ,
200+ rootCommands : [ 'ls' ] ,
201+ onConfirm : mockOnConfirm ,
202+ } as unknown as SerializableConfirmationDetails ,
203+ } ;
204+
205+ const { result } = renderHook ( ( ) => useToolActions ( ) , {
206+ wrapper : ( { children } ) => (
207+ < ToolActionsProvider config = { mockConfig } toolCalls = { [ legacyTool ] } >
208+ { children }
209+ </ ToolActionsProvider >
210+ ) ,
211+ } ) ;
212+
213+ await act ( async ( ) => {
214+ await result . current . confirm (
215+ 'legacy-call' ,
216+ ToolConfirmationOutcome . ProceedOnce ,
217+ ) ;
218+ } ) ;
219+
220+ expect ( mockOnConfirm ) . toHaveBeenCalledWith (
221+ ToolConfirmationOutcome . ProceedOnce ,
222+ undefined ,
223+ ) ;
224+ expect ( mockMessageBus . publish ) . not . toHaveBeenCalled ( ) ;
225+ } ) ;
185226} ) ;
0 commit comments