-
-
Notifications
You must be signed in to change notification settings - Fork 803
Exclude 'search_for_pattern' in ide-assistant context #538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Could this be a problem of the description?
Also, I don't see why it would need a lengthy description. |
We had that discussion in the past and adjusted the description (partly the reason for the huge docstring): a snippet:
|
OK, so the LLM is too stupid to apply it correctly. But perhaps we should cater to its stupidity and make it behave more like grep. |
Thing is, we really should have a good reason for each tool, and I don't think there is a good reason for this one |
In the ide context, I mean |
IDE context does not mean that there necessarily will be an alternative to this tool, so I don't really agree.
This sort of thing should never be in a tool description. It should be in system prompts.
This is overly lengthy. |
We should then both improve it and have a dedicated, optimized context for claude code (where the tool is not needed), which is what the majority of our users are using |
I think it should be mode, not a context. |
I don't know if this was affected by recent refactorings, but ignored files should never be searched and I hope they are not searched now |
Why mode? Modes can be switched dynamically, claude code is a prime example for an execution context, is it not? |
I was considering the mode as an option to specialise the context without undue repetition. We need to take a closer look at all the prompts. There are so many contradictions, questionable assumptions and imprecise formulations... For example, the ide-assitant context
|
yes, we should go through all prompts before the next release |
I vote for with disabling it. It brings no additional value over existing tools and just introduces complexity. I was just looking into options to improve the situation and maybe limit the output/context as this got abused by Claude and just cluttered the context. Not only with non greedy regex. But why do the work, when they are already existing tools ... And for instructions, those will always be interpreted quite differently by different models. YOU MUST is a given if you try to teach Claude something and even with this, he decides to ignore you so often. On the other hand GPT5 would never cross you like this. |
@rubas There are various ways in which this can be achieved. It opens up quite a big change to Serena conceptually, although technically it will all not be hard to implement. Just sharing my thoughts here. In summary - at startup Serena already knows the project language, the execution context, the active tools, and any specifics through the active modes (we could introduce special modes for models). If we make full use of that info in an extended prompt templating mechanism, we could probably enhance performance in the default configs by quite a bit, and this also nicely scales to a community of contributors. |
@MischaPanch
I would prefer to keep anything else out of that layer. I'm not sure (as I haven't tested) whether the edit capability via Serena represents an improvement. As I understand it, this project started with a different mindset. But this is a fast-moving target ;-) I'm concerned about long-term maintainability if we introduce too much model-specific/language-specific context. The project's goal shouldn't be teaching LLMs about languages—it should provide clear, unambiguous tools that enhance the understanding and add specific functionality. Fewer, well-designed tools are likely more effective... I'm not here to present solutions, but I've started thinking about different approaches lately. I find what's happening in the Elixir world around the MCP part of Tidewave very interesting: The Elixir ecosystem treats LSP as a first-class citizen (🥳 new Expert Elixir LSP got announced yesterday). With Tidewave's MCP implementation, they're experimenting with exposing all information sources - LSP data, documentation, framework-specific tooling, logs, eval, test and more - through one unified interface. (Not perfect or complete yet), but this unified framework specific approach feels very promising to me. |
I agree, and I feel like Serena does provide this. With the configuration one can reduce the tools to a minimum. I was talking about an additional goal - about possibly better default behavior for non-power users. You can reduce Serena to just |
Another aspect is that Serena is not just meant to enhance an agent but also to turn something like claude desktop into a capable agent. For that we just need more tools that wouldn't be needed for say just improving Claude Code |
I see your point. Still, I do question, if you don't overshoot...
Anyway, maybe I give it a run myself one day. |
Claude Desktop doesn't have any agent behavior as it can't access your code by default ;). Do you mean Claude Code? The initial idea was not to improve claude code but simply to write a good toolkit, to make it available through MCP, and to democratize the development of good agents. But the main popularity of Serena grew almost entirely because it does improve on Claude Code's internal tools. If Anthropic would have better tooling, this project would have likely remained a niche thing with a much smaller community |
Claude Code and most other ide assistants have capable pattern searching tools. Ours has quite a long description, cluttering the context, and I see times and times again that claude fails to write non-greedy regexes, leading to long matches. I think we should disable it by default in this context