Use a clone of Commands for sub-Coders, so main Command.coder does not get stomped

This commit is contained in:
Paul Gauthier 2024-08-03 10:01:57 -03:00
parent 47b6c6a8ef
commit ba8d32da42

View file

@ -778,6 +778,7 @@ class Commands:
edit_format="help", edit_format="help",
summarize_from_coder=False, summarize_from_coder=False,
map_tokens=512, map_tokens=512,
commands=self.clone(),
map_mul_no_files=1, map_mul_no_files=1,
) )
user_msg = self.help.ask(args) user_msg = self.help.ask(args)
@ -794,6 +795,14 @@ class Commands:
dict(role="assistant", content=assistant_msg), dict(role="assistant", content=assistant_msg),
] ]
def clone(self):
return Commands(
self.io,
None,
voice_language=self.voice_language,
verify_ssl=self.verify_ssl,
)
def cmd_ask(self, args): def cmd_ask(self, args):
"Ask questions about the code base without editing any files" "Ask questions about the code base without editing any files"
@ -808,6 +817,7 @@ class Commands:
from_coder=self.coder, from_coder=self.coder,
edit_format="ask", edit_format="ask",
summarize_from_coder=False, summarize_from_coder=False,
commands=self.clone(),
) )
user_msg = args user_msg = args