mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 02:34:59 +00:00
feat: improve keyboard interrupt message handling
This commit is contained in:
parent
491fb14eaa
commit
162204f28f
1 changed files with 5 additions and 4 deletions
|
@ -1367,10 +1367,11 @@ class Coder:
|
||||||
interrupted = True
|
interrupted = True
|
||||||
|
|
||||||
if interrupted:
|
if interrupted:
|
||||||
# check if the last messages was role==user, append the ^C Key.. to it if so. ai!
|
if self.cur_messages and self.cur_messages[-1]["role"] == "user":
|
||||||
self.cur_messages += [
|
self.cur_messages[-1]["content"] += "\n^C KeyboardInterrupt"
|
||||||
dict(role="user", content="^C KeyboardInterrupt"),
|
else:
|
||||||
dict(role="assistant", content="I see that you interrupted my previous reply."),
|
self.cur_messages += [dict(role="user", content="^C KeyboardInterrupt")]
|
||||||
|
self.cur_messages += [dict(role="assistant", content="I see that you interrupted my previous reply.")]
|
||||||
]
|
]
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue