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",
summarize_from_coder=False,
map_tokens=512,
commands=self.clone(),
map_mul_no_files=1,
)
user_msg = self.help.ask(args)
@ -794,6 +795,14 @@ class Commands:
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):
"Ask questions about the code base without editing any files"
@ -808,6 +817,7 @@ class Commands:
from_coder=self.coder,
edit_format="ask",
summarize_from_coder=False,
commands=self.clone(),
)
user_msg = args