karthink / gptel

A simple LLM client for Emacs
GNU General Public License v3.0
1.03k stars 111 forks source link

Persist all transient flags (round 2) #327

Open karthink opened 2 weeks ago

karthink commented 2 weeks ago

Yes, I realize that I can use C-x s to save the options, but I still find it jarring that gptel forgets some things if I don't do that. It is especially visible if I use I or J to inspect the generated query — I check the query, decide that it's OK, press q to get rid of the query buffer, and the next time I bring up gptel, the setup is different.

I can see that some options are kept between invocations, but some are not. For example, changing the model or temperature "sticks", but output options or the directive do not and get reset every time. This is the volatility/changeability that I mentioned.

I think what I mentally expect is that if I bring up the gptel menu, change some options, and bring it up again, everything will be exactly the same as the last time I saw the menu. In other words, I expect to be able to bring it up and quit it as I wish without worrying and checking what changed since the last time I saw the menu.

Originally posted by @jwr in https://github.com/karthink/gptel/issues/291#issuecomment-2166691926

(See also #94 for prior discussion)

karthink commented 2 weeks ago

Yes, I realize that I can use C-x s to save the options, but I still find it jarring that gptel forgets some things if I don't do that. It is especially visible if I use I or J to inspect the generated query — I check the query, decide that it's OK, press q to get rid of the query buffer, and the next time I bring up gptel, the setup is different.

Questions:

  1. I don't understand the "jarring" bit. If gptel-menu forgot all settings between invocations, would that be better?
  2. On the occasions where you remember to press C-x s, does everything work how you expect?
  3. What you would like is to never have to press C-x s, and the menu to remember all the options you've set. Is this the crux of the request?

As the name implies, the Transient library is designed around configuring commands in a transient way before calling them. For this reason, the settings that are currently persisted (like the model) are implemented in a way that's actually an exception -- it's an experimental transient feature. I'll see if I can find some method to make the other options persist as well.

jwr commented 2 weeks ago

The "jarring" comment was in the context of my work processes. When I use gptel I mostly think about something else (the text I'm working on). So, anything that detracts me from that work is a problem.

I find it "jarring" when some options I've just set disappear. The directive is the most prominent example: I set the directive, then notice a typo in the text, so I close the gptel menu, fix the typo, and when I bring gptel back it has already forgotten my directive. I then have to check what else it has forgotten. This detracts me from my work flow, which is why I used the word "jarring".

Regarding your other questions:

(2) Yes.

(3) Yes. Except perhaps if there are options which are obviously one-shot only — I can imagine there might be options for which remembering doesn't make sense, but I can't think of any right now.

I understand how the Transient library influenced how this works, but I really think gptel, especially used as a writing assistant, could benefit from keeping all options persistent.