Context-area files and repoMap freeze after the first turn
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- clojure
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Clojure
- 星标
- 1k
- 派生
- 82
- 平均合并
- 1 天 21 小时
- 30 天内合并 PR
- 25
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
editor-code-assistant/eca 的其他 Issue
-
Models doesn't work when fetchModels: false is used可能已有人在做 @zikajk 于 12 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
editor-code-assistant/eca#661 · 已指派 1 人 ·
维护者通常 2 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 52/100
editor-code-assistant/eca#685 ·
维护者通常 2 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
editor-code-assistant/eca#684 · 4 条评论 ·
维护者通常 2 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 74/100
editor-code-assistant/eca#672 ·
维护者通常 2 天内回复
-
难度 3/5 1-2 天 新手友好度 45/100
editor-code-assistant/eca#671 · 2 条评论 ·
维护者通常 2 天内回复
查看 editor-code-assistant/eca 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
calcit-lang/calcit#2538 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
-
comment above the first :require-macros libspec is hoisted onto the form可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug namespace v1 blocker
难度 2/5 1-3 小时 新手友好度 72/100
oakmac/standard-clojure-style-js#268 ·
维护者通常 1 天内回复
-
Bug: server save errors never reach the form (on-save-failed-expr unwraps the mutation result twice)未关闭bug
难度 2/5 1-3 小时 新手友好度 80/100
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复