#2106·serena

onboarding writes a project file but is not marked as an editing tool

Author: feiiiiii5Created Sep 26, 2026Updated Sep 26, 2026

name: Issue (bug, performance problem, etc.) about: General Issue title: '' labels: '' assignees: ''


Preconditions:

  • I have made sure it's an actual issue, not a question (use GitHub Discussions instead).
  • I have actually encountered this issue in practice. Issues that are based on (AI-based) code analysis only will be closed without comment.
  • I have consulted the user guide and verified that the issue cannot be resolved by adjusting configuration/following recommended workflows.
  • I have looked for similar issues and discussions, including closed ones.

Issue details:

  • I have provided a meaningful title and description.
  • I have explained how the issue arose and, where possible, added instructions on how to reproduce it.
  • I have added details on my setup: Serena version, MCP client, OS, the programming language(s), relevant configuration adjustments and project specifics.
  • If the issue relates to an application of Serena to an open-source project, I have added the link.

onboarding writes a project file but is not marked as an editing tool

OnboardingTool is the only tool that writes a project file without carrying ToolMarkerCanEdit. Two documented promises are enforced through exactly that marker, and both let the write through:

  • read_only: true — src/serena/resources/project.template.yml:120-122: "all editing tools will be disabled and attempts to use them will result in an error"; docs/02-usage/070_security.md:120-121: "Serena's own editing operations are refused".
  • QueryProjectTool — documented as executing "a read-only tool" in another project, enforced by assert tool.is_readonly() (src/serena/tools/query_project_tools.py:57).

Tool.is_readonly() is not self.can_edit() (tools_base.py:279-280), and can_edit() comes from the marker, so the whole question is whether the class carries it. onboarding does not, while its four sibling memory tools do — and calling it goes apply → MemoryApi.onboarding → ensure_memory_maintenance_memory → save_memory → write_file_atomic, creating .serena/memories/memory_maintenance.md from the shipped template.

I ran this on main at 7a296833 against a project with read_only: true: 20 editing tools are removed from the tool set and onboarding is not one of them; the call then wrote a 2043-byte memory file. No error, no warning.

Reproduction, output, and the two possible fixes
python
import tempfile
from pathlib import Path

from serena.agent import ToolSet
from serena.memories.memory_manager import MemoryManager
from serena.tools.tools_base import ToolRegistry

registry = ToolRegistry()
tool_set = ToolSet(set(registry.get_tool_names())).without_editing_tools()

print("onboarding available:", "onboarding" in tool_set.get_tool_names())
print("write_memory available:", "write_memory" in tool_set.get_tool_names())

with tempfile.TemporaryDirectory() as tmp:
    serena_dir = Path(tmp) / "demo" / ".serena"
    serena_dir.mkdir(parents=True)
    (serena_dir / "project.yml").write_text("read_only: true\n", encoding="utf-8")

    name = MemoryManager(serena_data_folder=serena_dir).ensure_memory_maintenance_memory()
    print("created:", (serena_dir / "memories" / f"{name}.md").exists())
onboarding     can_edit=False is_readonly=True  markers=[]
write_memory   can_edit=True  is_readonly=False markers=['ToolMarkerCanEdit', 'ToolMarker']
edit_memory    can_edit=True  is_readonly=False markers=['ToolMarkerCanEdit', 'ToolMarker']
delete_memory  can_edit=True  is_readonly=False markers=['ToolMarkerCanEdit', 'ToolMarker']
rename_memory  can_edit=True  is_readonly=False markers=['ToolMarkerCanEdit', 'ToolMarker']
read_memory    can_edit=False is_readonly=True  markers=[]

onboarding still available: True
write_memory still available: False
file created         : True
size                 : 2043

The same reasoning covers query_project: onboarding.is_readonly() is True, so the assert at query_project_tools.py:57 passes and the tool can be executed against a project the user only asked to query. There is no test for OnboardingTool's markers or for the read_only filter.

Two possible fixes, and the choice is yours.

  1. Add ToolMarkerCanEdit to OnboardingTool. One word, and read_only and query_project behave as documented. Side effects worth deciding on: mcp.py:109-114 derives destructive_hint from can_edit, so MCP clients would start seeing destructive_hint: true; and without_editing_tools() would drop onboarding from read-only projects entirely, so the agent could no longer read the memory-maintenance conventions there.
  2. Keep the tool available and skip the write. Leave the marker off and have MemoryApi.onboarding skip ensure_memory_maintenance_memory when the active project is read-only, returning the prompt without seeding the file. Preserves today's availability, but the tool's contract then has to say it may or may not write.

I lean towards 1, since both documented promises are already written in terms of editing tools, but 2 is defensible if keeping onboarding usable in read-only projects matters more.

Also worth a look either way: ActivateProjectTool and RemoveProjectTool (config_tools.py:51, :69) persist the global Serena config and carry no marker either. I have not confirmed a concrete problem there, so I am not reporting it as part of this issue.

Setup: Serena at 7a296833 (main), macOS, Python 3.11, no MCP client involved (the tool classes and the memory manager are exercised directly).