Open daedsidog opened 1 week ago
Talk about timing, I fixed this 10 minutes ago.
Also it doesn't cause any bugs in gptel's request, since this clean-up is done before the request is constructed. It's only the visual indicators (in the transient menu and now in the chat header too) that can be out of date as a result.
Talk about timing, I fixed this 10 minutes ago.
I'm on the latest master and I'm still getting it.
Also it doesn't cause any bugs in gptel's request, since this clean-up is done before the request is constructed. It's only the visual indicators (in the transient menu and now in the chat header too) that can be out of date as a result.
It does cause bugs when commandeering the context string generation functions, for example.
~I really think cleanup should be handled in the removal (unless there's a reason not to?)~ Actually, I see the issues with that. So, outside of commandeering the default string generation functions, is there any risk of the alist being polluted?
I'm on the latest master and I'm still getting it.
https://github.com/karthink/gptel/blob/master/gptel-context.el#L169
So, outside of commandeering the default string generation functions, is there any risk of the alist being polluted?
What do you mean by polluted?
I'm on the latest master and I'm still getting it.
https://github.com/karthink/gptel/blob/master/gptel-context.el#L169
This fix is incomplete, I guess I need this check in other places in this function too.
What do you mean by polluted?
Removing contexts programmatically leaves you with an alist of the form:
((#<buffer` main.c> #<overlay in no buffer>))
In such a case executing (gptel-context--string gptel-context--alist)
results in an error.
In such a case executing (gptel-context--string gptel-context--alist) results in an error.
Ah, this is what you meant by "commandeering the string generation". I'll fix it, but it's a low priority for now since doing this the right way (via customizing gptel-context-wrap-function
) should not cause any issues.
gptel-add
at pointgptel-context--alist
has an empty context, causing bugs later on.The problem lies in the fact that
gptel-remove-context
does no cleanup with the alist.