Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

Duplicate tasks created (#5358)

merwanehamadie0aa11f4d709
diff --git a/benchmark/agbenchmark/app.py b/benchmark/agbenchmark/app.py
index bd9b82737b..dccad64eb5 100644
--- a/benchmark/agbenchmark/app.py
+++ b/benchmark/agbenchmark/app.py
@@ -289,7 +289,6 @@ async def create_agent_task(task_eval_request: TaskEvalRequestBody) -> Task:
task_informations[task_response.task_id][
"eval_id"
] = task_eval_request.eval_id
- await api_instance.create_agent_task(task_request_body=task_request_body)
await upload_artifacts(
api_instance,
str(Path(CHALLENGES[task_eval_request.eval_id]["path"]).parent),
diff --git a/benchmark/tests/test_benchmark_workflow.py b/benchmark/tests/test_benchmark_workflow.py
index 25f3649623..92fbdbbd9d 100644
--- a/benchmark/tests/test_benchmark_workflow.py
+++ b/benchmark/tests/test_benchmark_workflow.py
@@ -31,11 +31,16 @@ def test_entire_workflow(
eval_id, input_text, expected_artifact_length, test_name, should_be_successful
):
task_request = {"eval_id": eval_id, "input": input_text}
-
+ response = requests.get(f"{URL_AGENT}/agent/tasks")
+ task_count_before = response.json()["pagination"]["total_items"]
# First POST request
task_response_benchmark = requests.post(
URL_BENCHMARK + "/agent/tasks", json=task_request
)
+ response = requests.get(f"{URL_AGENT}/agent/tasks")
+ task_count_after = response.json()["pagination"]["total_items"]
+ assert task_count_after == task_count_before + 1
+
timestamp_after_task_eval_created = datetime.datetime.now(datetime.timezone.utc)
time.sleep(1.1) # To make sure the 2 timestamps to compare are different
assert task_response_benchmark.status_code == 200