diff --git a/README.md b/README.md index 69e100718cc..e70585822f5 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,23 @@ OPENROUTER_API_KEY="..." DEEPSEEK_API_KEY="..." ``` +### Run Program + +If you are in the directory with your .aider.conf.yml file, then simply running `aider-ce` or `cecli` will start the agent with your configuration. If you want additional sandboxing, we publish a docker container that can be ran as follows: + +```bash +docker pull dustinwashington/aider-ce +docker run \ + -it \ + --user $(id -u):$(id -g) \ + --volume $(pwd):/app dustinwashington/aider-ce \ + --volume $(pwd)/.aider.conf.yml:/.aider.conf.yml \ + --volume $(pwd)/.aider.env:/.aider/.env \ + --config /app/.aider.conf.yml +``` + +This command will make sure all commands ran by the coding agent happen in context of the docker container to protect the house file system for any infamous agentic mishap + ## Project Roadmap/Goals The current priorities are to improve core capabilities and user experience of the Aider project diff --git a/aider/__init__.py b/aider/__init__.py index 2f616d59bae..2c8d3aa69ce 100644 --- a/aider/__init__.py +++ b/aider/__init__.py @@ -1,6 +1,6 @@ from packaging import version -__version__ = "0.89.2.dev" +__version__ = "0.89.3.dev" safe_version = __version__ try: diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 14146f8afb7..6e6f758af8b 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -3804,7 +3804,7 @@ async def run_shell_commands(self): self.commands.cmd_running = False async def handle_shell_commands(self, commands_str, group): - commands = commands_str.strip().splitlines() + commands = commands_str.strip().split(";") command_count = sum( 1 for cmd in commands if cmd.strip() and not cmd.strip().startswith("#") ) diff --git a/aider/coders/chat_chunks.py b/aider/coders/chat_chunks.py index 21c49f55087..ce2b547c152 100644 --- a/aider/coders/chat_chunks.py +++ b/aider/coders/chat_chunks.py @@ -62,10 +62,25 @@ def add_cache_control_headers(self): # The history is ephemeral on its own. self.add_cache_control(self.done) + # Per this: https://github.com/BerriAI/litellm/issues/10226 + # The first and second to last messages are cache optimal + # Since caches are also written to incrementally and you need + # the past and current states to properly append and gain + # efficiencies/savings in cache writing def add_cache_control(self, messages): - if not messages: + if not messages or len(messages) < 2: return + content = messages[-2]["content"] + if type(content) is str: + content = dict( + type="text", + text=content, + ) + content["cache_control"] = {"type": "ephemeral"} + + messages[-2]["content"] = [content] + content = messages[-1]["content"] if type(content) is str: content = dict( diff --git a/aider/io.py b/aider/io.py index 0e7bd5d6b78..79e8cf85fbd 100644 --- a/aider/io.py +++ b/aider/io.py @@ -296,7 +296,7 @@ class InputOutput: bell_on_next_input = False notifications_command = None encoding = "utf-8" - VALID_STYLES = {"bold", "red", "green", "blue", "orange"} + VALID_STYLES = {"bold", "red", "green", "blue", "bright_cyan"} VALID_OPEN_TAG_PATTERN = re.compile( r"\\\[(" + "|".join(re.escape(s) for s in VALID_STYLES) + r")\]" ) diff --git a/aider/models.py b/aider/models.py index 81a34efaec6..082e4300f67 100644 --- a/aider/models.py +++ b/aider/models.py @@ -977,11 +977,19 @@ async def send_completion( dump(kwargs) kwargs["messages"] = messages - # Cache System Prompts When Possible + # Per this: https://github.com/BerriAI/litellm/issues/10226 + # The first and second to last messages are cache optimal + # Since caches are also written to incrementally and you need + # the past and current states to properly append and gain + # efficiencies/savings in cache writing kwargs["cache_control_injection_points"] = [ { "location": "message", - "role": "system", + "index": -1, + }, + { + "location": "message", + "index": -2, }, ] diff --git a/aider/tools/utils/output.py b/aider/tools/utils/output.py index 2e21545e8f1..b038de924db 100644 --- a/aider/tools/utils/output.py +++ b/aider/tools/utils/output.py @@ -112,7 +112,7 @@ def color_markers(coder): Args: coder: An instance of base_coder """ - color_start = "[blue]" if coder.pretty else "" - color_end = "[/blue]" if coder.pretty else "" + color_start = "[bright_cyan]" if coder.pretty else "" + color_end = "[/bright_cyan]" if coder.pretty else "" return color_start, color_end diff --git a/docker/Dockerfile b/docker/Dockerfile index 2778dd7fcfe..7e223d07ae7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -70,4 +70,4 @@ RUN uv pip install . && \ # Switch to appuser USER appuser -ENTRYPOINT ["/venv/bin/aider"] +ENTRYPOINT ["/venv/bin/aider-ce"]