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:
Dominik Jain authored and Dominik Jain committed 2026-09-15 12:50:44 +02:00
1 parent d76dc3d870
commit 4b9ce9ad44
4 files changed
+32 -11

No files matched your search

+4
View File
@@ -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."""
+7
View File
@@ -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