mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-11 03:13:51 +00:00
Fix: read_only restriction in project definition was not applied to base tool set when in single-project context
Fixes #1938
This commit is contained in:
1 parent
7fcbca7e62
commit
43ae0211d7
2 files changed
+5
No files matched your search
@@ -5,6 +5,7 @@ Status of the `main` branch. Changes prior to the next official version change w
|
||||
* General:
|
||||
- Fix: Parallel agents auto-registering projects could overwrite each other's changes to the global
|
||||
project list in `serena_config.yml`
|
||||
- Fix: `read_only` restriction in project definition was not applied to base tool set when in single-project context (#1938)
|
||||
|
||||
* Language Servers:
|
||||
- Fix: Dart's `$/analyzerStatus` notifications were logged as unhandled-method warnings during analysis (#1855)
|
||||
|
||||
@@ -794,6 +794,7 @@ class SerenaAgent:
|
||||
# of tools that will be exposed to the client.
|
||||
# Furthermore, we disable tools that are only relevant for project activation.
|
||||
# So if the project exists, we apply all the aforementioned exclusions.
|
||||
apply_read_only = False
|
||||
if is_single_project:
|
||||
assert project is not None
|
||||
log.info(
|
||||
@@ -807,9 +808,12 @@ class SerenaAgent:
|
||||
)
|
||||
)
|
||||
tool_inclusion_definitions.append(project.project_config)
|
||||
apply_read_only = project.project_config.read_only
|
||||
|
||||
# compute the resulting tool set
|
||||
base_toolset = ToolSet.default().apply(*tool_inclusion_definitions)
|
||||
if apply_read_only:
|
||||
base_toolset = base_toolset.without_editing_tools()
|
||||
log.info(f"Number of exposed tools: {len(base_toolset)}")
|
||||
return base_toolset
|
||||
|
||||
|
||||
Reference in new issue
Block a user