mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-16 06:14:41 +00:00
Place the REPL's facade listing in the tool description or the activation message
* single-project sessions: in the REPL tool's description (fixed at registration) * otherwise: in the project activation message (facades depend on the activated project) * REPL tool description wording adjusted (listing location, notebook semantics) Peripheral changes: * is_tool_function_available: in REPL mode, active tools without facade counterparts count as available
This commit is contained in:
1 parent
d76dc3d870
commit
4b9ce9ad44
4 files changed
+32
-11
No files matched your search
@@ -29,6 +29,10 @@ class MockAgent:
|
||||
def get_repl() -> SerenaRepl:
|
||||
return SerenaRepl([], ApiScope())
|
||||
|
||||
@staticmethod
|
||||
def is_single_project() -> bool:
|
||||
return False
|
||||
|
||||
|
||||
class BaseMockTool(Tool):
|
||||
"""A mock Tool class for testing."""
|
||||
|
||||
@@ -919,6 +919,13 @@ class TestSerenaAgent:
|
||||
assert exposed == expected
|
||||
assert "s.lsp" in agent.get_tool(SerenaReplTool).apply(agent.create_session().session_id, "s.info()")
|
||||
|
||||
# the facade listing is part of the (fixed) tool description in single-project sessions,
|
||||
# and of the activation message otherwise (where the facades depend on the activated project)
|
||||
tool_description = agent.get_tool(SerenaReplTool).get_apply_docstring()
|
||||
activation_message = agent.get_project_activation_message("test_session")
|
||||
assert ("s.lsp:" in tool_description) == context.single_project
|
||||
assert ("s.lsp:" in activation_message) == (not context.single_project)
|
||||
|
||||
# prompts refer to operations by their qualified REPL names, e.g. `lsp.find_symbol` instead of the tool name
|
||||
system_prompt = agent.create_system_prompt()
|
||||
assert "`lsp.find_symbol`" in system_prompt
|
||||
|
||||
Reference in new issue
Block a user