Skip to content

Commit 66165aa

Browse files
committed
The return of the confirmation chunk
1 parent b27befd commit 66165aa

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

interpreter/core/async_core.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,12 @@ def respond(self, run_code=None):
8080
run_code = self.auto_run
8181

8282
for chunk in self._respond_and_store():
83-
if chunk["type"] == "confirmation":
84-
if run_code:
85-
continue # We don't need to send out confirmation chunks on the server. I don't even like them.
86-
else:
87-
break
83+
# To preserve confirmation chunks, we add this to the bottom instead
84+
# if chunk["type"] == "confirmation":
85+
# if run_code:
86+
# continue
87+
# else:
88+
# break
8889

8990
if self.stop_event.is_set():
9091
return
@@ -101,6 +102,10 @@ def respond(self, run_code=None):
101102

102103
self.output_queue.sync_q.put(chunk)
103104

105+
if chunk["type"] == "confirmation":
106+
if not run_code:
107+
break
108+
104109
self.output_queue.sync_q.put(
105110
{"role": "server", "type": "status", "content": "complete"}
106111
)

0 commit comments

Comments
 (0)