0.11 new task loops question
# marvin-ai
d
0.11 new task loops question
So I have a weird question about how tasks work in a loop.
This is what I'm getting when I loop on a task. It just keeps returning success for me.
This is my code loop, with a new task created, but the same agent:
Copy code
succeeded = False
        things_we_tried = []
        i = 0
        while not succeeded and i < MAX_TRIES:
            i += 1
            # Create a task for the exploit agent using the tools and results from recon
            exploit_task = cf.Task(
                code_inject_exploit_sysmsg,
                agents=[exploitagent],
                tools=[PythonRunnerTool(), CommandRunnerTool()],
                context={
                           "workbook": code_injection_workbook,
                           "target_website": start_url,
                           "recon_result": str(endpoint),  # Pass the recon result
                           "things_we_tried": str(things_we_tried),
                       },
                result_type=ExploitResult,
                completion_tools=["SUCCEED"]
            )

            # Execute the exploit task
            exploit_result = exploit_task.run()
            succeeded = exploit_result.succeeded
            things_we_tried += exploit_result.things_we_tried

            print("Exploit Result: %s" % exploit_result)
I should...in theory...try try again? But it just gives up right away and calls SUCCEEDED.