mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-14 16:18:03 +00:00
Re-enable InitialInstructionsTool, because some clients do not read the system prompt
at connection time (e.g. Claude Desktop) Establish a "name" for the instructions (Serena Instructions Manual) such that the agent can know whether it has read the instructions and therefore will know whether or not the tool needs to be called
This commit is contained in:
1 parent
570703d0ae
commit
70ab5e77bf
2 files changed
+9
-8
No files matched your search
@@ -64,3 +64,5 @@ prompts:
|
||||
{% for prompt in mode_system_prompts %}
|
||||
- {{ prompt }}
|
||||
{% endfor %}
|
||||
|
||||
You have hereby read the 'Serena Instructions Manual' and do not need to read it again.
|
||||
@@ -122,18 +122,17 @@ class PrepareForNewConversationTool(Tool):
|
||||
return self.prompt_factory.create_prepare_for_new_conversation()
|
||||
|
||||
|
||||
class InitialInstructionsTool(Tool, ToolMarkerDoesNotRequireActiveProject, ToolMarkerOptional):
|
||||
class InitialInstructionsTool(Tool, ToolMarkerDoesNotRequireActiveProject):
|
||||
"""
|
||||
Gets the initial instructions for the current project.
|
||||
Should only be used in settings where the system prompt cannot be set,
|
||||
e.g. in clients you have no control over, like Claude Desktop.
|
||||
Provides instructions on how to use the Serena toolbox.
|
||||
Should only be used in settings where the system prompt is not read automatically by the client.
|
||||
|
||||
NOTE: Some MCP clients (including Claude Desktop) do not read the system prompt automatically!
|
||||
"""
|
||||
|
||||
def apply(self) -> str:
|
||||
"""
|
||||
Get the initial instructions for the current coding project.
|
||||
If you haven't received instructions on how to use Serena's tools in the system prompt,
|
||||
you should always call this tool before starting to work (including using any other tool) on any programming task,
|
||||
the only exception being when you are asked to call `activate_project`, which you should then call before.
|
||||
Provides the 'Serena Instructions Manual', which contains essential information on how to use the Serena toolbox.
|
||||
Call this tool if you have not yet read this very important manual!
|
||||
"""
|
||||
return self.agent.create_system_prompt()
|
||||
Reference in new issue
Block a user