#agent loop repeats
1 messages ยท Page 1 of 1 (latest)
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
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
Ok thanks, I'm trying that
๐ trying what you suggested here but not sure if I'm doing this correctly - can you help me debug why the agent is not returning a standard diff at the end of the first run? https://github.com/vikram-dagger/fastapi-sample-app/pull/52 and trace at https://v3.dagger.cloud/dagger/traces/3bf02fbffb8ccad9a49c7cf305308b7c
i tried making the prompt more explicit but no change, this is the next iteration which has the same problem: https://v3.dagger.cloud/dagger/traces/267722cbaeed354005bf4ccd67625e86
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 ๐
yes, makes sense - thanks! trying now
this works consistently now, ty!