Skip to content

Onboarding tool fails with FileNotFoundError after #1477 — memory_maintenance.md packaged at old path #1503

@timur-da

Description

@timur-da

Summary

After #1477 "Revamp Memory System" (merged 2026-05-18), calling the onboarding MCP tool fails immediately with FileNotFoundError because the memory_maintenance.md template is shipped at the old path while the new MemoryManager code resolves it from a new path that does not exist.

Version

  • serena --versionSerena 1.5.1.dev0
  • Repo HEAD at install time: 1c5cf348 (tip of main ~6h after Revamp Memory System #1477 was merged)
  • Install method: uvx --from git+https://github.com/oraios/serena serena start-mcp-server --context ide-assistant --project <path>

Repro

  1. Install latest serena via uvx (as above).
  2. Connect from any MCP client (verified: Claude Code).
  3. Call the onboarding tool on a fresh project (no existing memories).
  4. Observe:

```
Error executing tool: FileNotFoundError - Memory maintenance template not found at
/home/dev/.cache/uv/archive-v0/.../lib/python3.11/site-packages/serena/memories/resources/memory_maintenance.md
```

Root cause

`src/serena/memories/memory_manager.py:87`:

```python
_MEMORY_MAINTENANCE_TEMPLATE_PATH: Path = Path(file).parent / "resources" / "memory_maintenance.md"
```

`Path(file).parent` is `src/serena/memories/`, so this resolves to `src/serena/memories/resources/memory_maintenance.md`.

But the file is actually installed at `src/serena/resources/memory_maintenance.md` (its location before the reorganization). The `memories/resources/` directory does not exist in the wheel at all — only the `.py` files are present under `src/serena/memories/`.

This affects both the wheel installed by `uvx` and the source checkout at HEAD — i.e. it is a packaging-config gap, not a wheel-build issue.

Suggested fix

Either:

  • (A) Move the resource to `src/serena/memories/resources/memory_maintenance.md` and update build config (`pyproject.toml` / `MANIFEST.in`) to include it under the new location. This matches the code's intent — the template lives next to the manager that owns it.
  • (B) Keep the file where it is and change the constant to `Path(file).parent.parent / "resources" / "memory_maintenance.md"`.

(A) seems more aligned with the spirit of the reorganization that introduced the `memories/` package; happy to send a PR if you confirm preference.

Workaround

Symlink works locally until the next `uvx` refresh:

```bash
SERENA=$(python -c 'import serena, pathlib; print(pathlib.Path(serena.file).parent)')
mkdir -p "$SERENA/memories/resources"
ln -sf "$SERENA/resources/memory_maintenance.md" "$SERENA/memories/resources/memory_maintenance.md"
```

After this, `onboarding` succeeds and `read_memory("memory_maintenance")` returns the template as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions