mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
fix: Handle KeyboardInterrupt in show_send_output_stream
This commit is contained in:
parent
c286135eeb
commit
fb0066cbf0
1 changed files with 3 additions and 6 deletions
|
@ -1259,9 +1259,9 @@ class Coder:
|
||||||
yield from self.show_send_output_stream(completion)
|
yield from self.show_send_output_stream(completion)
|
||||||
else:
|
else:
|
||||||
self.show_send_output(completion)
|
self.show_send_output(completion)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt as kbi:
|
||||||
self.keyboard_interrupt()
|
self.keyboard_interrupt()
|
||||||
interrupted = True
|
raise kbi
|
||||||
finally:
|
finally:
|
||||||
self.io.log_llm_history(
|
self.io.log_llm_history(
|
||||||
"LLM RESPONSE",
|
"LLM RESPONSE",
|
||||||
|
@ -1276,10 +1276,7 @@ class Coder:
|
||||||
if args:
|
if args:
|
||||||
self.io.ai_output(json.dumps(args, indent=4))
|
self.io.ai_output(json.dumps(args, indent=4))
|
||||||
|
|
||||||
if interrupted:
|
self.calculate_and_show_tokens_and_cost(messages, completion)
|
||||||
raise KeyboardInterrupt
|
|
||||||
|
|
||||||
self.calculate_and_show_tokens_and_cost(messages, completion)
|
|
||||||
|
|
||||||
def show_send_output(self, completion):
|
def show_send_output(self, completion):
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue