feat: Add placeholder parameter to SwitchCoder

This commit is contained in:
Paul Gauthier (aider) 2025-03-22 18:32:25 -07:00
parent 4d61b596ff
commit 99b0209c89
2 changed files with 6 additions and 1 deletions

View file

@ -28,8 +28,9 @@ from .dump import dump # noqa: F401
class SwitchCoder(Exception):
def __init__(self, **kwargs):
def __init__(self, placeholder=None, **kwargs):
self.kwargs = kwargs
self.placeholder = placeholder
class Commands:

View file

@ -1109,6 +1109,10 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
except SwitchCoder as switch:
coder.ok_to_warm_cache = False
# Set the placeholder if provided
if hasattr(switch, 'placeholder') and switch.placeholder is not None:
io.placeholder = switch.placeholder
kwargs = dict(io=io, from_coder=coder)
kwargs.update(switch.kwargs)
if "show_announcements" in kwargs: