eca icon indicating copy to clipboard operation
eca copied to clipboard

Feature request: chat-scoped "approve & remember" + a command to reset it

Open snoopier opened this issue 1 month ago • 1 comments

To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.

Feature request: chat-scoped "approve & remember" + a command to reset it

Hi 👋

First of all — thank you so much for ECA! It has become an essential part of my daily workflow in Emacs, and the granular shell approval keys from #153 are a really nice touch.

Current behavior

Approvals remembered via "approve & remember" are stored server-wide in the global db under :tool-calls (src/eca/db.clj). This means:

  • an approval remembered in one chat also applies to all other chats and subagents,
  • /clear or opening a new chat does not reset them,
  • the only way to revoke them is to stop/restart the server.

From a user's point of view "session" reads like "this chat", so this was a bit surprising to me.

Proposal

A. Scope remembered approvals to the chat

  • Store them under the (root) chat, e.g. [:chats <root-chat-id> :approval-memory …].
  • Subagents resolve to their parent via db/parent-chat-id, so they inherit the parent's approvals without having to ask again.
  • Keep them in-memory only (as today), drop them in normalize-chat-for-write.
  • /clear resets them naturally.

B. Commands to inspect / reset within the chat

  • /approvals — list the remembered approvals of the current chat.
  • /forget-approvals — revoke all remembered approvals of the current chat, without restarting the server or losing the conversation.

Trade-offs

  • Users will see a few more prompts in new chats. Read-only commands can be put into allow permanently, which is arguably the cleaner approach anyway.
  • Changing the scope is a small behavior change worth a line in the changelog — it only ever results in more prompts, never fewer.

Suggested tests

  • a remembered approval in chat A does not auto-approve in chat B
  • a subagent inherits the parent chat's remembered approvals
  • /clear resets the chat's remembered approvals
  • /forget-approvals empties the current chat's remembered approvals, other chats stay untouched

Thanks again for all the work you put into ECA — it's a joy to use. Happy to help with a PR if you like the direction. 🙏

snoopier avatar Oct 09 '26 08:10 snoopier

Thanks @snoopier, I took a look and implemented this as it looked like a nice improvement, LMK if any issues

ericdallo avatar Oct 13 '26 17:10 ericdallo