Support tools in rewrite
For models without native web search, it'd be useful for eca-rewrite to leverage some tool/mcp for internet access.
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.
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.
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
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.
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
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
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.