Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Double Responses from Continue Action #1606

Merged
merged 5 commits into from
Dec 31, 2024

Conversation

azep-ninja
Copy link
Contributor

@azep-ninja azep-ninja commented Dec 31, 2024

Relates to:

Risks

Low

Background

What does this PR do?

What kind of change is this?

Bug fixes (non-breaking change which fixes an issue)

This PR fixes a double response issue that was caused by the CONTINUE action in the plugin-bootstrap. The agent would respond to the same message multiple time due to the continue trigger.

Documentation changes needed?

N/A

Testing

Where should a reviewer start?

Detailed testing steps

Test sending a message, watch logs for CONTINUE message to be triggered, watch logs as agent logs that a response has already been sent to an existing message or not responding further.

The double response was seen as triggered in a CONTINUE action whe the agent would ask/frame response a certain way back to the user. Which on subsequent messages, would trigger the callback to respond to the same message multiple times.

Where the continue action is meant for a natural flow of thoughts to keep generating, on normal back and forth convo's it would duplicate response.

Fix below now stops that as it takes into consideration its own message it just responded to, and how it framed to either not respond again, or continue a thought as it was intended.

---TESTING Screen Record---
1st section shows a previous double response, which is triggered by the question the agent asked to the user, which in turn triggers a double response on the next reply from the user

2nd section shows continue being triggered as normal, but not triggering another response in the handler callback since it already responded. This will still allow continue to allow the agent to "continue" a thought it had as it was intended, also, per the examples.

Untitled.video.-.Made.with.Clipchamp.19.1.mp4

Deploy Notes

Database changes

Deployment instructions

Discord username

ninja_dev

Copy link
Collaborator

@monilpat monilpat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for doing this can you please add a test (screengrab works) that this actually resolved the double response issue - it LGTM but want to confirm thanks :)

@azep-ninja
Copy link
Contributor Author

azep-ninja commented Dec 31, 2024

@monilpat

Edited main post with screen grab and more detail, and how I found the issue, and what caused the issue.

Will be good to get validation from people after, but I did extensive testing on TG/Discord clients, and presume it would solve the issues across other clients as well.

@azep-ninja azep-ninja requested a review from monilpat December 31, 2024 19:09
monilpat
monilpat previously approved these changes Dec 31, 2024
Copy link
Collaborator

@monilpat monilpat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me thanks for the thorough testing :)

@monilpat
Copy link
Collaborator

monilpat commented Dec 31, 2024

It looks like unrelated changes are causing issues. Do you mind running the following command

To see if it happens locally
pnpm build

If it doesn't run and resubmit
pnpm i -r --no-frozen-lockfile

@azep-ninja
Copy link
Contributor Author

It looks like unrelated changes are causing issues. Do you mind running the following command

To see if it happens locally pnpm build

If it doesn't run and resubmit pnpm i -r --no-frozen-lockfile

Did a re-build, and confirmed it started up locally without issues, and re-pushed.

@azep-ninja azep-ninja requested a review from monilpat December 31, 2024 20:39
Copy link
Collaborator

@monilpat monilpat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@monilpat monilpat merged commit 30cc542 into elizaOS:develop Dec 31, 2024
3 checks passed
@azep-ninja azep-ninja deleted the fix/continue-double-response branch December 31, 2024 21:08
@Mr-Don-Leo
Copy link

This is a good fix, prior it was an issue of boredom. However, the added conditions and checks were pretty good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants