gptel
gptel copied to clipboard
User message lost when redirecting to another buffer
Please update gptel first -- errors are often fixed by the time they're reported.
- [x] I have updated gptel to the latest commit and tested that the issue still exists
Bug Description
This appears to be a fairly basic bug. Am I misunderstanding how this is supposed to function? I tested older versions back to 0.9.7, and they all behaved the same way, suggesting it wasn't introduced in a recent commit, or that this is the expected behavior and my mental model is wrong.
Backend
None
Steps to Reproduce
-
Create a new empty buffer in either fundamental-mode or gptel-mode.
-
Enter a prompt (Apua, apua, kissa syö rapua!).
-
Execute
M-x gptel-menu. -
Press
Jto inspect the request. The expected JSON should appear:
{
"model": "gpt-4o-mini",
"messages": [
{
"role": "system",
"content": "You are a large language model living in Emacs and a helpful assistant. Respond concisely."
},
{
"role": "user",
"content": "Apua, apua, kissa syö rapua!"
}
],
"stream": true,
"temperature": 1.0
}
- Press
C-c C-kto cancel, then hitdand enter a new buffer name. Inspect again with `J. The resulting request only contains the system message:
{
"model": "gpt-4o-mini",
"messages": [
{
"role": "system",
"content": "You are a large language model living in Emacs and a helpful assistant. Respond concisely."
}
],
"stream": true,
"temperature": 1.0
}
-
Repeat the above steps with
g(response to gptel buffer). The behavior is inconsistent; sometimes only the system message is included, while other times the user message appears. -
Test with
e(echo area) andk(kill-ring) – these consistently work as expected.
Additional Context
Emacs version 29.4 on linux.
Backtrace
Log Information