#agent loop repeats

1 messages ยท Page 1 of 1 (latest)

sick vector
#

Still trying to figure this issue out, it was happening earlier as well and I tried changing the prompt etc but it didn't seem to make a difference

#

The agent completes the job halfway through the trace but when asked to summarize, seems to start at the beginning and repeat all the steps again

ruby dew
#

Since the llm still has the full context, it seems like it's still taking that initial prompt as it's assignment. The last prompt ("summarize your changes") doesn't override that in any way. It's probably easiest to get the diff out of after and pass it to a new llm I think

sick vector
#

Ok thanks, I'm trying that

sick vector
ruby dew
#

yeah so you're asking the agent to run the diff tool and return the output:

"""
...
- Once all the tests pass, you are done. Run the diff tool and return its output.
        """
        diff = await (
            dag.llm()
            .with_workspace(before)
            .with_prompt(prompt)
            .last_reply()
        )

but really what you want is probably:

# (delete the last line of the prompt)
work = (
            dag.llm()
            .with_workspace(before)
            .with_prompt(prompt)
        )
diff = await work.workspace().diff()

just use the diff tool ๐Ÿ™‚

sick vector
#

yes, makes sense - thanks! trying now

sick vector