File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
packages/cli/src/commands Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,8 @@ export const command: CommandModule<SharedOptions, DefaultArgs> = {
109109 // Use command line option if provided, otherwise use config value
110110 tokenTracker . tokenCache = config . tokenCache ;
111111
112+ const backgroundTools = new BackgroundTools ( 'mainAgent' ) ;
113+
112114 try {
113115 // Early API key check based on model provider
114116 const providerSettings =
@@ -209,7 +211,7 @@ export const command: CommandModule<SharedOptions, DefaultArgs> = {
209211 model : config . model ,
210212 maxTokens : config . maxTokens ,
211213 temperature : config . temperature ,
212- backgroundTools : new BackgroundTools ( 'mainAgent' ) ,
214+ backgroundTools,
213215 } ) ;
214216
215217 const output =
@@ -225,6 +227,8 @@ export const command: CommandModule<SharedOptions, DefaultArgs> = {
225227 ) ;
226228 // Capture the error with Sentry
227229 captureException ( error ) ;
230+ } finally {
231+ await backgroundTools . cleanup ( ) ;
228232 }
229233
230234 logger . log (
You can’t perform that action at this time.
0 commit comments