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

Remember conversation stopped working in 2025.3 #259

Open
krisf12 opened this issue Mar 6, 2025 · 1 comment
Open

Remember conversation stopped working in 2025.3 #259

krisf12 opened this issue Mar 6, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@krisf12
Copy link

krisf12 commented Mar 6, 2025

Describe the bug
A clear and concise description of what the bug is.

I recently updated to home assistant 2025.3 but I was having similar issues before updating. I was on 2025.2.4 and it would only remember a few past messages and then throw an “unable to communicate with the api” error.

Now I’m not getting any past messages remembered. I’ll say “tell me a joke” and then say “another” and it will say “sorry I’m not sure what you’re referring to” when in the past it would tell me another joke.

Expected behavior
A clear and concise description of what you expected to happen.

I expected it to remember past interactions up to 5 messages like before but even setting it to 2 does not work at all.

Logs
If applicable, please upload any error or debug logs output by Home Assistant.

Paste logs here
@krisf12 krisf12 added the bug Something isn't working label Mar 6, 2025
@skye-harris
Copy link

I've run into this issue as well, and upon doing a little digging, it looks like Home Assistant have updated how they manage conversations somewhat... with Home Assistant itself now being able to handle conversation histories.

The notable change that breaks this plugins history though is that Home Assistant itself now handles generating conversation IDs, however this plugin generates a new conversation ID itself if the provided one does not exist in the plugins own internal conversation history.

I was able to get this working again by simply disabling the generation of new conversation IDs within the plugin itself, and only ever use the one provided by Home Assistant.

I did this by editing \config\custom_components\llama_conversation\conversation.py on my HomeAssistant instance, changing this block:

https://github.com/acon96/home-llm/blob/develop/custom_components/llama_conversation/conversation.py#L358-L363

    if user_input.conversation_id in self.history:
        conversation_id = user_input.conversation_id
        conversation = self.history[conversation_id] if remember_conversation else [self.history[conversation_id][0]]
    else:
        conversation_id = ulid.ulid()
        conversation = []

to:

    conversation_id = user_input.conversation_id
    if user_input.conversation_id in self.history:
        conversation = self.history[conversation_id] if remember_conversation else [self.history[conversation_id][0]]
    else:
        conversation = []

Just to be clear: this is not a complete fix in that it does not update the plugin properly to support the new means of HA handling chat history etc. This simply gets the plugins own internal chat history working again (which, frankly, is good enough for me until the maintainer has the time to attend to this properly)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants