File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed
Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change 6161WAIT_OVERRIDE = {
6262 101 : 4.0 ,
6363 102 : 4.0 ,
64- 103 : 12 .0 ,
65- 104 : 15 .0 ,
64+ 103 : 20 .0 ,
65+ 104 : 25 .0 ,
6666 105 : 6.0 ,
67- 106 : 12 .0 ,
68- 107 : 12 .0 ,
67+ 106 : 20 .0 ,
68+ 107 : 25 .0 ,
6969}
7070
7171def drain (proc , seconds = 2.0 ):
@@ -218,16 +218,16 @@ def run():
218218 }
219219 }
220220
221- wait_time = WAIT_OVERRIDE .get (payload ["id" ], 3 .0 )
222- out = send (proc , payload , wait = wait_time )
221+ wait_time = WAIT_OVERRIDE .get (payload ["id" ], 5 .0 )
222+ out = send (proc , payload , wait = wait_time ) + drain ( proc , wait_time )
223223
224- if not out . strip ():
225- # Some tools (especially ones calling local LLMs) can take longer than
226- # our initial wait window. Give them more time and capture any output.
227- extra_wait = max ( 5.0 , wait_time )
228- extra = drain ( proc , extra_wait )
229- if extra :
230- out += extra
224+ # If the tool still hasn't produced output (possible for long-running AI calls),
225+ # keep waiting in generous chunks until we see something or the process exits.
226+ while not out . strip ():
227+ extra = drain ( proc , wait_time )
228+ if not extra . strip ():
229+ break
230+ out += extra
231231
232232 if payload ["id" ] == 102 :
233233 vec2_output = out
You can’t perform that action at this time.
0 commit comments