Skip to content

Commit 12d0637

Browse files
committed
Add post code injection for code replacement awareness
1 parent efdc8d1 commit 12d0637

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

aider/coders/mixture_of_architects_coder.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def get_architect_response(self, architect, current_user_message):
274274
)
275275
case "assistant":
276276
# If its the current architect, then we use role=assistant
277-
if msg["name"] == architect.name.upper():
277+
if msg["name"] == architect.name.upper() or msg["name"] == "ANY":
278278
ask_coder.cur_messages.append(
279279
{"role": "assistant", "content": msg["content"]}
280280
)
@@ -689,6 +689,23 @@ def run_coding_phase(self, message):
689689
self.io.rule()
690690
editor_coder.run(with_message=compiled_instructions, preproc=False)
691691

692+
693+
# Inject implementation notice to discussion
694+
self.discussion_messages.append(
695+
{
696+
"role": "user",
697+
"content": "We have implemented the plan. Refer to the latest code state",
698+
}
699+
)
700+
self.discussion_messages.append(
701+
{
702+
"role": "assistant",
703+
"name": "ANY",
704+
"content": "Okay, i'll refer to the latest code state",
705+
}
706+
)
707+
708+
692709
self.move_back_cur_messages(
693710
"Changes have been applied based on architects' consensus."
694711
)

0 commit comments

Comments
 (0)