@@ -94,7 +94,11 @@ describe('media tool path validation', () => {
9494 mocks . resolveWorkspaceFileReference . mockResolvedValue ( null )
9595
9696 const result = await generateAudioServerTool . execute (
97- { prompt : 'Clone this voice' , inputs : { files : [ { path : '' } ] } } ,
97+ {
98+ prompt : 'Clone this voice' ,
99+ inputs : { files : [ { path : '' } ] } ,
100+ outputs : { files : [ { path : 'files/voice.mp3' } ] } ,
101+ } ,
98102 CONTEXT
99103 )
100104
@@ -140,6 +144,34 @@ describe('media tool path validation', () => {
140144 expect ( mocks . runFfmpegOperation ) . not . toHaveBeenCalled ( )
141145 } )
142146
147+ it ( 'ignores unused output declarations for ffmpeg probes' , async ( ) => {
148+ mocks . resolveWorkspaceFileReference . mockResolvedValue ( UPLOAD_RECORD )
149+ mocks . runFfmpegOperation . mockResolvedValue ( { probe : { duration : 3 } } )
150+
151+ const result = await ffmpegServerTool . execute (
152+ {
153+ operation : 'probe' ,
154+ inputs : { files : [ { path : 'files/input.mov' } ] } ,
155+ outputs : { files : [ { path : 'uploads/unused.json' } ] } ,
156+ } ,
157+ CONTEXT
158+ )
159+
160+ expect ( result . success ) . toBe ( true )
161+ expect ( mocks . validateWorkspaceFileWriteTarget ) . not . toHaveBeenCalled ( )
162+ expect ( mocks . writeWorkspaceFileByPath ) . not . toHaveBeenCalled ( )
163+ } )
164+
165+ it ( 'rejects missing generated-media outputs before calling the provider' , async ( ) => {
166+ const result = await generateVideoServerTool . execute (
167+ { prompt : 'Create a launch video' } ,
168+ CONTEXT
169+ )
170+
171+ expect ( result . success ) . toBe ( false )
172+ expect ( mocks . generateFalVideo ) . not . toHaveBeenCalled ( )
173+ } )
174+
143175 it ( 'passes uploads/ media files to ffmpeg' , async ( ) => {
144176 mocks . resolveChatUpload . mockResolvedValue ( UPLOAD_RECORD )
145177
@@ -166,6 +198,7 @@ describe('media tool path validation', () => {
166198 {
167199 prompt : 'Animate these portraits' ,
168200 inputs : { files : [ { path : 'files/one.png' } , { path : 'files/two.png' } ] } ,
201+ outputs : { files : [ { path : 'files/output.mp4' } ] } ,
169202 } ,
170203 CONTEXT
171204 )
0 commit comments