mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-04 03:35:00 +00:00
refactor: Handle KeyboardInterrupt with user-assistant message pair and add env check for sanity_check_messages
This commit is contained in:
parent
843720a671
commit
42ef4352f4
2 changed files with 7 additions and 3 deletions
|
@ -1359,8 +1359,10 @@ class Coder:
|
||||||
interrupted = True
|
interrupted = True
|
||||||
|
|
||||||
if interrupted:
|
if interrupted:
|
||||||
content += "\n^C KeyboardInterrupt"
|
self.cur_messages += [
|
||||||
self.cur_messages += [dict(role="assistant", content=content)]
|
dict(role="user", content="^C KeyboardInterrupt"),
|
||||||
|
dict(role="assistant", content="I see that you interrupted my previous reply."),
|
||||||
|
]
|
||||||
return
|
return
|
||||||
|
|
||||||
edited = self.apply_updates()
|
edited = self.apply_updates()
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import hashlib
|
import hashlib
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from aider.dump import dump # noqa: F401
|
from aider.dump import dump # noqa: F401
|
||||||
|
@ -51,7 +52,8 @@ def send_completion(
|
||||||
):
|
):
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# sanity_check_messages(messages)
|
if os.environ.get("AIDER_SANITY_CHECK_TURNS"):
|
||||||
|
sanity_check_messages(messages)
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue