mirror of
https://github.com/andrewyng/openworker.git
synced 2026-09-12 23:29:55 +00:00
engine: Stop works in every state, not just between iterations
Stream drops between chunks (+ the pre-first-token wait); pending approvals/questions/plans resolve as interrupted. Running shell commands die via an executor interrupt hook; skipped tool calls still get results (no orphans). Also fixes delete_session calling a nonexistent engine.interrupt().
This commit is contained in:
@@ -308,6 +308,8 @@ def build_engine(
|
||||
model=model,
|
||||
instructions=instructions,
|
||||
approver=approver,
|
||||
# Stop kills the in-flight foreground shell command, not just the loop.
|
||||
interrupt_hooks=[executor.interrupt_now] if executor is not None else None,
|
||||
max_iterations=(
|
||||
max_iterations if max_iterations is not None else config.max_iterations
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user