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

User message lost when redirecting to another buffer #646

Open
1 task done
pabl0 opened this issue Feb 15, 2025 · 0 comments
Open
1 task done

User message lost when redirecting to another buffer #646

pabl0 opened this issue Feb 15, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@pabl0
Copy link
Contributor

pabl0 commented Feb 15, 2025

Please update gptel first -- errors are often fixed by the time they're reported.

  • 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

  1. Create a new empty buffer in either fundamental-mode or gptel-mode.

  2. Enter a prompt (Apua, apua, kissa syö rapua!).

  3. Execute M-x gptel-menu.

  4. Press J to 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
}
  1. Press C-c C-k to cancel, then hit d and 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
}
  1. 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.

  2. Test with e (echo area) and k (kill-ring) – these consistently work as expected.

Additional Context

Emacs version 29.4 on linux.

Backtrace

Log Information

@pabl0 pabl0 added the bug Something isn't working label Feb 15, 2025
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

1 participant