eca icon indicating copy to clipboard operation
eca copied to clipboard

Support tools in rewrite

Open sg-qwt opened this issue 1 year ago • 7 comments

For models without native web search, it'd be useful for eca-rewrite to leverage some tool/mcp for internet access.

sg-qwt avatar Nov 17 '25 15:11 sg-qwt

Currently, no tools are passed (besides built-in like websearch for models that support) to rewrite for the reason that it's mostly a sync feature, so if LLM requires tools to be approved, that wouldn't work without too much effort (same for completion).

We have some options to discuss:

  • Only run tools that don't require approval
  • Evolve the protocol to ask to user if it should run a tool, this one is harder and would need move thinking on the UI.

ericdallo avatar Nov 17 '25 16:11 ericdallo

I think it's good to keep rewrite lightweight. The current UX of rewrite is good. So maybe a configuration under rewrite to allow certain tools/mcps to run without approval is enough, no need to disrupt the flow with manual approve I think.

sg-qwt avatar Nov 17 '25 16:11 sg-qwt

I wonder what's best:

  • require user to specify tools via config
  • allow all default like we do for chat, but if it requires approval, we ignore it and don't pass to LLM.

c/c @zikajk

ericdallo avatar Nov 17 '25 16:11 ericdallo

This is not something I need, so I'll add what came to mind: would it make sense to define a behavior and assign it to the rewrite? Once I finish the hooks, I plan to add 'enabled_tools' to the behavior, and if the user specifies within that behavior that everything should be automatically allowed, it would work. The advantage would be that they could also test their own system prompt, and so on.

EDIT: Ah, it just occurred to me that the system prompt is very specific, so it's probably not a good idea... maybe it would be better just to extend the rewrite settings.

zikajk avatar Nov 18 '25 15:11 zikajk

Yeah, extend rewrite is probably better, especially because we don't want that a rewrite behavior be available in the chat, so we would need to create this concept of not showing behaviors

ericdallo avatar Nov 18 '25 15:11 ericdallo

I just saw a Primeagen's video with a similar idea :-). He's using tree-sitter instead of tools to gather context though. https://www.youtube.com/watch?v=MNvciiZ5x9A

zikajk avatar Dec 28 '25 10:12 zikajk

Yeah, tree-sitter would be a way but since we already have tools support, I believe it's just a matter of providing user a way to configure which ones to use or exclude, considering what happens if needs approval or fail to run etc.

ericdallo avatar Dec 29 '25 13:12 ericdallo