fe: rename /iterate to /batch

This commit is contained in:
yozerpp 2025-04-25 18:38:13 +03:00
parent 2cd9e57192
commit 808b16d27b
4 changed files with 10 additions and 10 deletions

View file

@ -8,7 +8,7 @@ from .editor_whole_coder import EditorWholeFileCoder
from .help_coder import HelpCoder from .help_coder import HelpCoder
from .udiff_coder import UnifiedDiffCoder from .udiff_coder import UnifiedDiffCoder
from .wholefile_coder import WholeFileCoder from .wholefile_coder import WholeFileCoder
from .iterate_coder import IterateCoder from .batch_coder import BatchCoder
# from .single_wholefile_func_coder import SingleWholeFileFunctionCoder # from .single_wholefile_func_coder import SingleWholeFileFunctionCoder
__all__ = [ __all__ = [
@ -17,7 +17,7 @@ __all__ = [
Coder, Coder,
EditBlockCoder, EditBlockCoder,
EditBlockFencedCoder, EditBlockFencedCoder,
IterateCoder, BatchCoder,
WholeFileCoder, WholeFileCoder,
UnifiedDiffCoder, UnifiedDiffCoder,
# SingleWholeFileFunctionCoder, # SingleWholeFileFunctionCoder,

View file

@ -4,10 +4,10 @@ import copy
from aider.coders.base_coder import Coder from aider.coders.base_coder import Coder
from aider.coders.base_prompts import CoderPrompts from aider.coders.base_prompts import CoderPrompts
"""Perform a coding task on multiple files in batches that fit the context and outpot token limits, without sending them all at once.""" """Perform a coding task on multiple files in batches that fit the context and outpot token limits, without sending them all at once."""
class IterateCoder(Coder): class BatchCoder(Coder):
coder : Coder = None coder : Coder = None
original_kwargs: dict = None original_kwargs: dict = None
edit_format = "iterate" edit_format = "batch"
def __init__(self, main_model, io, **kwargs): def __init__(self, main_model, io, **kwargs):
super().__init__(main_model, io,**kwargs) super().__init__(main_model, io,**kwargs)

View file

@ -1064,9 +1064,9 @@ class Commands:
map_mul_no_files=map_mul_no_files, map_mul_no_files=map_mul_no_files,
show_announcements=False, show_announcements=False,
) )
def cmd_iterate(self, args): def cmd_batch(self, args):
"""Iteratively perform the change on files in batches that fit to context and output limits""" """Iteratively perform the change on files in batches that fit to context and output limits"""
return self._generic_chat_command(args, "iterate") return self._generic_chat_command(args, "batch")
def cmd_ask(self, args): def cmd_ask(self, args):
"""Ask questions about the code base without editing any files. If no prompt provided, switches to ask mode.""" # noqa """Ask questions about the code base without editing any files. If no prompt provided, switches to ask mode.""" # noqa
return self._generic_chat_command(args, "ask") return self._generic_chat_command(args, "ask")

View file

@ -9,7 +9,7 @@ from aider.repo import GitRepo
from aider.utils import GitTemporaryDirectory from aider.utils import GitTemporaryDirectory
class TestIterateCoder(unittest.TestCase): class TestBatchCoder(unittest.TestCase):
def setUp(self): def setUp(self):
self.GPT35 = Model("gpt-3.5-turbo") self.GPT35 = Model("gpt-3.5-turbo")
self.io = InputOutput(yes=True) self.io = InputOutput(yes=True)
@ -25,15 +25,15 @@ class TestIterateCoder(unittest.TestCase):
main_model=self.GPT35, main_model=self.GPT35,
io=self.io, io=self.io,
fnames=self.files, fnames=self.files,
edit_format='iterate' edit_format='batch'
) )
def tearDown(self): def tearDown(self):
# self.webbrowser_patcher.stop() # self.webbrowser_patcher.stop()
return return
"""Tests that: """Tests that:
- Every request retains the chat history until the /iterate command but not the history of other iterations. - Every request retains the chat history until the /batch command but not the history of other iterations.
- Added files and history until the /iterate is unmodified. - Added files and history until the /batch is unmodified.
- Every file is processed(even if a single file that'll be sent with the request exceeds the limits.) and no duplicate processing - Every file is processed(even if a single file that'll be sent with the request exceeds the limits.) and no duplicate processing
""" """
def test_iterate_resets_history_and_processes_all_files(self): def test_iterate_resets_history_and_processes_all_files(self):