Context-area files and repoMap freeze after the first turn
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- clojure
- Ambito
- backend-api-design, documentation
Direzione di ricerca
Start with eca.features.chat/prompt and the eca-chat--send-prompt entry point named in the issue; use the described mock-LLM test to trace how context-area files and repoMap reach each turn. Check the prompt-cache signature and the context-change notice as well. Done means current contexts are sent as proposed without duplicating prompt chips, pinned instructions remain pinned, and docs/features.md is corrected.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
The context area is the line above the prompt. The editor sends its items in contexts.
ECA renders :file and :repoMap contexts into the system prompt.
ECA pins this prompt (keeps it fixed for the whole chat) unless chat.autoSyncSystemPrompt is true. The default is false.
So after turn 1, the model does not see changes to these contexts.
Expected: the model sees the current context area on every turn.
Bugs
Reproduced on master (3cf9b05) with a test that calls eca.features.chat/prompt and a mock LLM. Default config, unless stated.
- New context is never sent. Add
b.txtorrepoMapto the context area after turn 1. The model never gets it. Typing@repoMapin the prompt does not help: the server parses only@/,@~and@.paths from the text. - Edited file keeps old content. Edit
a.txtafter turn 1. ECA keeps sending the old text. Its block says "Treat as current and accurate". - Removed file stays. Remove
a.txtfrom the context area. ECA still sends it in every request. - Prompt chip is sent twice. eca-emacs also sends
@fileitems from the prompt text (chips) incontexts(eca-chat--send-prompt, since eca-emacs6f8d5ef). The server cannot tell them from context-area items. The model gets the file in the user message and in the system prompt. The system prompt copy stays for the rest of the chat. Other clients: not checked. - Notice is vague and repeats. ECA shows "System prompt changed (contexts), keeping current chat system prompt...". It does not say that the attached file is not sent. With bug 4 it shows again and again, because chips come and go.
- repoMap goes stale with no warning. The cache signature stores only
:presentfor repoMap (to avoidgit ls-fileson every cache hit). A changed file tree is never detected, also withautoSyncSystemPrompt: true. The agent creates and renames files, so the map is soon wrong.
Root cause
:file and :repoMap are in static-prompt-context-types. This is the same pinned block as AGENTS.md and the rules. Pinning is right for instructions. It is wrong for data that changes.
Workaround
Set chat.autoSyncSystemPrompt: true. It fixes bugs 1 to 3. But each change then breaks the prompt cache (the provider's stored copy of the processed prompt). With bug 4, each prompt chip breaks it twice: when the chip appears, and on the next turn. Bugs 4 and 6 stay. For bug 6, /sync-system-prompt refreshes the map by hand.
Proposal
Send :file and :repoMap in the user message, after the user text. The cursor already works this way (#464).
- Send the content once, when it is new.
- If it changes later, send one line. The model reads it again with its tools.
- If the user removes it, send nothing.
- Skip a path that the prompt text already expands with
@path. Prompt@stays as it is. - Keep AGENTS.md and the rules in the pinned system prompt.
- Fix the text "one-time only context" in
docs/features.md.
NOTE: It might make sense to get rid of '@' in the context area completely. But I think that these are good reasons to keep it:
- It stays attached. The client sends the context-area list on every message until you remove an item. A prompt
@works for one message only. - It can stay current (after the fix). ECA sends a short "file changed" line. A prompt
@is a snapshot (a copy from one moment). To refresh it, you mention the file again, and the full file enters the history again. Today this point is the bug. - It survives
/compact(the command that summarizes old messages). Prompt@text is gone after/compact, and only the summary stays. I know this from the code, not from a run.
- Lingua principale
- Clojure
- Stelle
- 1k
- Fork
- 82
- Merge medio
- 1g 21h
- PR unite (30g)
- 25
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di editor-code-assistant/eca
-
Models doesn't work when fetchModels: false is usedForse già presa @zikajk l’ha presa 12 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
editor-code-assistant/eca#661 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
editor-code-assistant/eca#685 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
editor-code-assistant/eca#684 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 74/100
editor-code-assistant/eca#672 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
editor-code-assistant/eca#671 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di editor-code-assistant/eca
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
calcit-lang/calcit#2538 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
comment above the first :require-macros libspec is hoisted onto the formForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug namespace v1 blocker
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
oakmac/standard-clojure-style-js#268 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: server save errors never reach the form (on-save-failed-expr unwraps the mutation result twice)Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno