From fe6b3d64a9474658f3f1680946f50ca97ba1bc96 Mon Sep 17 00:00:00 2001 From: Zvonimir Sabljic Date: Sun, 28 Jul 2024 18:47:55 -0700 Subject: [PATCH 1/3] Fix for when a command is being debugged - we want Developer to parse tasks and continue --- core/agents/error_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/agents/error_handler.py b/core/agents/error_handler.py index 66dbe05ce..0150bf3c1 100644 --- a/core/agents/error_handler.py +++ b/core/agents/error_handler.py @@ -111,7 +111,7 @@ async def handle_command_error(self, message: str, details: dict) -> AgentRespon "description": llm_response, "alternative_solutions": [], "attempts": 1, - "status": IterationStatus.HUNTING_FOR_BUG, + "status": IterationStatus.IMPLEMENT_SOLUTION, "bug_hunting_cycles": [], } ] From 52a21ee80223e955a9b700662276d8889368e2d3 Mon Sep 17 00:00:00 2001 From: Zvonimir Sabljic Date: Sun, 28 Jul 2024 18:49:18 -0700 Subject: [PATCH 2/3] Expand the output context size when we use Sonnet --- core/llm/anthropic_client.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/llm/anthropic_client.py b/core/llm/anthropic_client.py index f458a7b2b..1fc7d1d01 100644 --- a/core/llm/anthropic_client.py +++ b/core/llm/anthropic_client.py @@ -15,6 +15,7 @@ # Maximum number of tokens supported by Anthropic Claude 3 MAX_TOKENS = 4096 +MAX_TOKENS_SONNET = 8192 class AnthropicClient(BaseLLMClient): @@ -72,6 +73,11 @@ async def _make_request( "messages": messages, "temperature": self.config.temperature if temperature is None else temperature, } + + if "sonnet" in self.config.model: + completion_kwargs["extra_headers"] = {"anthropic-beta": "max-tokens-3-5-sonnet-2024-07-15"} + completion_kwargs["max_tokens"] = MAX_TOKENS_SONNET + if json_mode: completion_kwargs["response_format"] = {"type": "json_object"} From 694438d8eb3b67a89c7a23d196bd226697cc324a Mon Sep 17 00:00:00 2001 From: Zvonimir Sabljic Date: Sun, 28 Jul 2024 18:49:46 -0700 Subject: [PATCH 3/3] Small improvement for breakdown.prompt so that important info is at the end --- core/prompts/developer/breakdown.prompt | 31 +++++++++++++------------ 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/core/prompts/developer/breakdown.prompt b/core/prompts/developer/breakdown.prompt index f11511961..51715cbe7 100644 --- a/core/prompts/developer/breakdown.prompt +++ b/core/prompts/developer/breakdown.prompt @@ -4,21 +4,6 @@ You are working on an app called "{{ state.branch.project.name }}" and you need {% include "partials/features_list.prompt" %} {% include "partials/files_list.prompt" %} -We've broken the development of this {% if state.epics|length > 1 %}feature{% else %}app{% endif %} down to these tasks: -``` -{% for task in state.tasks %} -{{ loop.index }}. {{ task.description }}{% if task.get("status") == "done" %} (completed){% endif %} -{% endfor %} -``` - -You are currently working on task #{{ current_task_index + 1 }} with the following description: -``` -{{ task.description }} -``` -{% if current_task_index != 0 %}All previous tasks are finished and you don't have to work on them.{% endif %} - -Now, tell me all the code that needs to be written to implement ONLY this task and have it fully working and all commands that need to be run to implement this task. - {% include "partials/doc_snippets.prompt" %} {%- if state.epics|length == 1 %} @@ -35,3 +20,19 @@ DO NOT specify commands to create any folders or files, they will be created aut {% include "partials/file_size_limit.prompt" %} Never use the port 5000 to run the app, it's reserved. + +--IMPLEMENTATION INSTRUCTIONS-- +We've broken the development of this {% if state.epics|length > 1 %}feature{% else %}app{% endif %} down to these tasks: +``` +{% for task in state.tasks %} +{{ loop.index }}. {{ task.description }}{% if task.get("status") == "done" %} (completed){% endif %} +{% endfor %} +``` + +You are currently working on task #{{ current_task_index + 1 }} with the following description: +``` +{{ task.description }} +``` +{% if current_task_index != 0 %}All previous tasks are finished and you don't have to work on them.{% endif %} + +Now, tell me all the code that needs to be written to implement ONLY this task and have it fully working and all commands that need to be run to implement this task.