positron icon indicating copy to clipboard operation
positron copied to clipboard

Assistant: user-added context is only remembered for one prompt

Open lbrenes-epi opened this issue 4 months ago • 5 comments

System details:

Positron and OS details:

Positron Version: 2025.08.0 (Universal) build 130 Code - OSS Version: 1.102.0 macOS: Sequoia 15.6

Session details:

R 4.4.3 Claude 4 Sonnet

Describe the issue:

Assistant doesn't remember added context from previous prompt, and user needs to re-add context files.

Steps to reproduce the issue:

Image

lbrenes-epi avatar Aug 23 '25 19:08 lbrenes-epi

Thank you so much for this report! I am able to reproduce this on a new build as well:

Positron Version: 2025.09.0 build 109
Code - OSS Version: 1.103.0
Commit: 912f51f6aab10ddfd533a46a5b80612129f8b10b
Date: 2025-08-25T03:34:02.110Z
Electron: 37.2.3
Chromium: 138.0.7204.100
Node.js: 22.17.0
V8: 13.8.500258-electron.0
OS: Darwin arm64 24.6.0

This seems to happen even if you are not using the Shiny Assistant.

isabelizimm avatar Aug 25 '25 14:08 isabelizimm

Thanks for this report, @lbrenes-epi! I want to make sure that I understand what you are describing, because I think this may be as intended. When you attach a file like prep.R to the context for a single conversational turn, you see it in the little box for when you added it. After that, for the whole rest of that chat, all the text you wrote, all the text generated by the LLM, and all the files you attached are all in the history; the files are not removed from the context/history.

Are you seeing any behavior that leads you to think something has gone wrong with the history or context? Or were you more asking about the UI display?

juliasilge avatar Aug 27 '25 20:08 juliasilge

Hello @juliasilge ,

Unless I continuously re-add context files, positron assistant will only “look” at the active file (app.R). For example, when I was re-prompting @shiny to correct its previous app.R output, it didn’t “remember” to consider prep.R data structure and functions again in the same conversation unless I re-added prep.R in “Add Context”.

This is in contrast to the ChatGPT UI where if I give it prep.R, ada.css, and app.R scripts, it will “remember” their contents even much later in the same conversation thread, as I adjust app.R with the LLM.

Please let me know if I can clarify further. Thanks!

lbrenes-epi avatar Aug 27 '25 21:08 lbrenes-epi

Thank you for the clarification, @lbrenes-epi!

juliasilge avatar Aug 29 '25 01:08 juliasilge

Let's investigate to figure out:

  • the attached file context should be included in the chat history starting from the request it was included in
    • even if the file content is persisted in the user message in the chat history and still “available”, it won’t have the latest version of the file
  • are the models actually ignoring the file context from the historical prompt
  • does including the file context every time lead to a better experience? We think attaching this every time may not improve the response and would add to token count
  • tension between the file being visually attached in the UI and uncertainty whether or not the context is still attached and can be referenced
  • let's investigate the design decisions around not re-attaching the context with every request
    • balancing user understanding and whether the quality of the response can be improved

sharon-wang avatar Oct 14 '25 17:10 sharon-wang