fix(runner): keep installation context within each stream resume

This commit is contained in:
Hyu
2026-09-15 13:51:27 +08:00
parent 9db097399c
commit d497defbf7
4 changed files with 203 additions and 24 deletions
+10 -7
View File
@@ -48,12 +48,15 @@ class RunnerInvoker:
context=context,
)
while True:
try:
result_dict = await self._next_with_deadline(gen, descriptor, context)
except StopAsyncIteration:
break
yield result_dict
try:
while True:
try:
result_dict = await self._next_with_deadline(gen, descriptor, context)
except StopAsyncIteration:
break
yield result_dict
finally:
await self._close_generator(gen, descriptor)
except asyncio.TimeoutError as e:
raise RunnerExecutionError(
@@ -128,4 +131,4 @@ class RunnerInvoker:
try:
await gen.aclose()
except Exception as e:
self.ap.logger.warning(f'Failed to close timed-out runner {descriptor.id}: {e}')
self.ap.logger.warning(f'Failed to close runner {descriptor.id}: {e}')