Commit 834224c
committed
refactor(cli,compiler): close litellm async clients inside the compile loop
#91 closed litellm's cached async clients from the CLI layer in a separate
asyncio.run(), i.e. after the loop that created them was already torn down,
with the error swallowed by a bare except. Close them in the same loop that
created them instead, by moving the cleanup into the compile coroutines.
- add compiler._close_async_llm_clients() (best-effort, logs at debug)
- call it from compile_short_doc / compile_long_doc finally blocks
- drop cli._close_litellm_async_clients() and the three try/finally wraps
- drop the no-op cleanup around index_long_document (indexer uses no litellm)
- revert the test_add_command assertion to assert_called_once()1 parent 933fd12 commit 834224c
3 files changed
Lines changed: 44 additions & 45 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
362 | 379 | | |
363 | 380 | | |
364 | 381 | | |
| |||
1981 | 1998 | | |
1982 | 1999 | | |
1983 | 2000 | | |
1984 | | - | |
1985 | | - | |
1986 | | - | |
1987 | | - | |
1988 | | - | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
1989 | 2011 | | |
1990 | 2012 | | |
1991 | 2013 | | |
| |||
2026 | 2048 | | |
2027 | 2049 | | |
2028 | 2050 | | |
2029 | | - | |
2030 | | - | |
2031 | | - | |
2032 | | - | |
2033 | | - | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | 262 | | |
277 | 263 | | |
278 | 264 | | |
| |||
321 | 307 | | |
322 | 308 | | |
323 | 309 | | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
| 310 | + | |
328 | 311 | | |
329 | 312 | | |
330 | 313 | | |
| |||
334 | 317 | | |
335 | 318 | | |
336 | 319 | | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
344 | 324 | | |
345 | 325 | | |
346 | 326 | | |
| |||
354 | 334 | | |
355 | 335 | | |
356 | 336 | | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
| 337 | + | |
361 | 338 | | |
362 | 339 | | |
363 | 340 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
| 148 | + | |
154 | 149 | | |
0 commit comments