Save task action and parse task properly

This commit is contained in:
mijauexe
2025-04-01 13:36:01 +02:00
parent e8b731169a
commit 244358f9a6
2 changed files with 4 additions and 2 deletions

View File

@@ -258,7 +258,7 @@ class Developer(ChatWithBreakdownMixin, RelevantFilesMixin, BaseAgent):
# There might be state leftovers from previous tasks that we need to clean here
self.next_state.modified_files = {}
self.set_next_steps(response, source)
self.next_state.action = DEV_TASK_START.format({current_task_index + 1})
self.next_state.action = DEV_TASK_START.format(current_task_index + 1)
await telemetry.trace_code_event(
"task-start",
{

View File

@@ -1,6 +1,7 @@
import json
import os
import os.path
import re
import sys
from argparse import ArgumentParser, ArgumentTypeError, Namespace
from difflib import unified_diff
@@ -489,7 +490,8 @@ async def load_convo(
if state.action is not None:
if "Task" in state.action and "start" in state.action:
task_counter = int(state.action.split("#")[1].split()[0])
match = re.search(r"Task\s+#\s*(?:\{)?(\d+)(?:\})?", state.action)
task_counter = int(match.group(1))
elif state.action == DEV_TROUBLESHOOT.format(task_counter):
if state.iterations is not None and len(state.iterations) > 0: