Skip to content

Serena fails to perfrom simple rename_symbol taks #725

@IvanKablar

Description

@IvanKablar

Serena MCP rename_symbol fails silently, requires manual fallback

Description

The rename_symbol operation in Serena MCP Server is failing to perform actual renames, despite reporting success. When attempting to rename a Java class symbol, the operation claims success but renames 0 files, requiring
immediate fallback to manual shell commands.

Steps Executed

  1. Use find_symbol to locate a class symbol (e.g., CameraActivity in a Java file)
  2. Call rename_symbol with the found symbol to rename it to a new name (e.g., MyCameraActivity)
  3. Observe the result

Expected Behavior

The rename_symbol operation should:

  • Rename the symbol in all files where it appears
  • Rename the file itself if it's a class definition
  • Report the actual number of files modified
  • Complete the operation without requiring fallback mechanisms

Actual Behavior

✓ rename_symbol (serena MCP Server)
{"name_path":"CameraActivity","relative_path":"app/src/main/java/com/example/biofotoapp/CameraActivity.java","new_name":"MyCameraActivity"}

 Successfully renamed 'CameraActivity' to 'MyCameraActivity' in 0 file(s)

The operation reports success but indicates 0 files were modified. The system then had to fall back to:

  1. Manual mv shell commands (first attempt even had a path typo)
  2. Manual text search showing 17 remaining references to the old name

Impact

This makes the rename_symbol feature unreliable and forces users/agents to manually handle renames through multiple fallback steps, defeating the purpose of having a dedicated rename operation.

Environment

  • MCP Server: Serena
  • CLI: Gemini CLI
  • Language: Java
  • File type: .java class file
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions