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

Re-asking Human message duplicates the message #587

Open
rjwignar opened this issue Apr 13, 2024 · 6 comments · May be fixed by #616
Open

Re-asking Human message duplicates the message #587

rjwignar opened this issue Apr 13, 2024 · 6 comments · May be fixed by #616
Assignees

Comments

@rjwignar
Copy link
Collaborator

I noticed when editing and re-asking a message, ChatCraft duplicates my updated message:
messageDuplication

@rjwignar rjwignar added this to the Release 2.0 milestone Apr 13, 2024
@rjwignar rjwignar self-assigned this Apr 13, 2024
@rjwignar
Copy link
Collaborator Author

This bug seems to have been introduced in 7cc1e2f
This PR fixes #541, in which re-asking with a valid web handler target would not invoke the web handler.

When you enter a valid web handler URL, ChatCraft responds with a User message with the web handler output:
image

I think the changes in 7cc1e2f will send any re-asked message to the web handler, and if it's not a web handler target, ChatCraft will respond with a User message containing text identical to the re-asked message.

Investigating possible solutions now

@rjwignar
Copy link
Collaborator Author

rjwignar commented Apr 18, 2024

Console.log() statements ChatBase.tsx::215 and inside if condition at ChatBase::216 confirms non-web handler targets aren't passed to webHandler.
Investigating further.

Still investigating, but it looks like because we're now passing the prompt text from the Resubmit handler to the onPrompt, when you resend a regular message meant for the LLM, onPrompt will create a duplicate of the edited message.

@rjwignar rjwignar removed this from the Release 2.0 milestone Apr 19, 2024
@rjwignar
Copy link
Collaborator Author

rjwignar commented Apr 19, 2024

Still working on this, but won't be finished by the deadline.

I have a fix in mind. Will hopefully make a PR tomorrow

@tarasglek
Copy link
Owner

any updates on this?

@rjwignar
Copy link
Collaborator Author

I'll have a PR ready tonight.

@rjwignar
Copy link
Collaborator Author

When studying this I noticed the duplication only occurs with a regular prompt, but to determine an ideal fix I had to study how other kinds of re-ask actions were affected by 7cc1e2f (e.g. slash commands, web handlers).

Below are the observations I've made.
7cc1e2f fixes more than just web-handler retries, but also fixes slash command retries.

Task Observations pre- 7cc1e2f (tested using adcfd2d) Observations post- 7cc1e2f (tested using Production as of e4967a9) (Prompt duplication bug observed)
Ask with "help" (to invoke /help) Executes /help command Executes /help command
Re-ask with "help" (to invoke /help) Response from LLM Executes /help command
Ask with web handler Executes web handler Executes web handler
Re-ask with web handler Response from LLM Executes web handler
Ask with slash command (/import) Invokes /import Invokes /import
Re-ask with slash command (/import) Response from LLM Invokes /import
Ask with regular prompt Response from LLM Response from LLM
Re-ask with regular prompt Response from LLM Response from LLM, updated prompt message duplicated

These observations suggest the only thing that should be fixed is regular prompt messages being duplicated, the PR will be ready shortly.

@rjwignar rjwignar linked a pull request Apr 25, 2024 that will close this issue
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 a pull request may close this issue.

2 participants