-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Monster branch rebased #1223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MischaPanch
wants to merge
16
commits into
main
Choose a base branch
from
monster_branch_rebased
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Monster branch rebased #1223
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
621fe02
Conftest: added get_pytest_markers
MischaPanch 5ae7314
Feature: move symbol WIP
MischaPanch 6a281d5
Added safe_delete and inline_symbol tools (JB backend)
MischaPanch bc5a6e1
Added SafeDeleteSymbol in LS world
MischaPanch dc812ea
Gitignore
MischaPanch 86ea36f
Add TY support for python, mark LS that support implementation request
MischaPanch fcce94b
LS: mark LS that support implementation request
MischaPanch 6b556f9
Exclude test resources from formating
MischaPanch f44f38f
Diagnostics, find defining and implementing symbol tools, WIP
MischaPanch a3d804d
Security enhancement: pinned all runtime deps, verify checksums
MischaPanch 69f70e8
Restructured serena_agent tests, reifying the cases
MischaPanch a9bb52a
JB inspection and implementation tools, WIP
MischaPanch e9a090d
Fixes in CORE PATH LOGIC: get_relative_path
MischaPanch 62c09c2
Fixes in CORE PATH LOGIC: propagate changes from past commit
MischaPanch e24952c
Fix in test_serena_agent.py: use normalize_relative_path - fixup this…
MischaPanch cb3b20a
Added dedicated doc on features, WIP
MischaPanch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,165 @@ | ||
| # Features | ||
|
|
||
| Serena is essentially an **IDE for coding agents** -- it gives LLMs the same kind of structural code understanding | ||
| that human developers get from their IDEs, but through interfaces purpose-built for agents. | ||
| Serena supports both the **Language Server (LS)** backend (free, open-source) and the **JetBrains (JB)** plugin backend. | ||
| The LS backend is the broadly available baseline. | ||
| The JetBrains backend is the premium option, offering a deeper IDE-native workflow and significantly broader functionality. | ||
|
|
||
| ## General | ||
|
|
||
| Serena is designed around a few core principles: | ||
|
|
||
| - **Agent-first tool design** -- Serena's tools operate on **symbols and name paths** rather than on lines and columns. | ||
| This is a deliberate design choice: line numbers and column offsets are fragile and shift with every edit, | ||
| making them unreliable anchors for agents working on evolving code. | ||
| Symbols (classes, methods, functions) are stable, meaningful identifiers that agents can reason about naturally. | ||
| Tool results are compact JSON, keeping token usage low and output qujuality high. | ||
| - **LLM- and framework-independent** -- Serena is not tied to any specific LLM, agent framework, or interface. It works with any MCP-compatible client | ||
| and can be integrated into custom agent pipelines. | ||
| - **Lightweight** -- Serena runs as a standalone MCP server. Language servers are downloaded automatically on demand. With the JetBrains backend, no additional downloads or processes are required. | ||
| - **Project-based configuration** -- Each project can have its own configuration, language servers, and memory store. Modes and contexts allow | ||
| tailoring the active tool set to the workflow at hand. | ||
| - **Memories** -- A simple but effective Markdown-based memory system allows agents to persist and retrieve project knowledge across sessions, | ||
| including automatic onboarding for new projects. | ||
|
|
||
| ## Navigation | ||
|
|
||
| Serena's navigation tools allow agents to explore codebases at the symbol level, understanding structure and relationships | ||
| without reading entire files. | ||
|
|
||
| | Capability | Language Server | JetBrains Plugin | | ||
| |-------------------------------------|--------------------------------------|-----------------------| | ||
| | **Symbol overview** (file outline) | yes | yes | | ||
| | **Find symbol** (by name path) | yes | yes | | ||
| | **Find referencing symbols** | yes | yes | | ||
| | **Find implementations** | yes (limited language support) | yes (all languages) | | ||
| | **Go to definition** | yes | yes | | ||
| | **Type hierarchy** (super/subtypes) | -- | yes | | ||
| | **Search in dependencies** | -- | yes | | ||
|
|
||
| The JetBrains backend supports **find implementations** across all languages, whereas the LS backend is limited to | ||
| languages whose language server supports it (e.g., not Python). The **type hierarchy** and **dependency search** are | ||
| JetBrains-exclusive features. | ||
|
|
||
| <!-- TODO: Add navigation demo video here | ||
| <video src="" | ||
| controls | ||
| preload="metadata" | ||
| style="max-width: 100%; height: auto;"> | ||
| Your browser does not support the video tag. | ||
| </video> | ||
| --> | ||
|
|
||
| ## Refactoring | ||
|
|
||
| Serena supports safe, codebase-wide refactoring operations. | ||
|
|
||
| | Capability | Language Server | JetBrains Plugin | | ||
| |---------------------------------------------|-----------------|------------------| | ||
| | **Rename symbol** | yes | yes | | ||
| | **Safe delete** | yes | yes | | ||
| | **Propagate deletions, remove unused code** | -- | yes | | ||
| | **Move** (symbol, file, directory) | -- | yes | | ||
| | **Inline method** | -- | yes | | ||
|
|
||
| **Rename** updates all references across the codebase automatically. | ||
| The JetBrains backend adds **move** (relocate symbols, files, or directories with automatic reference updates), | ||
| **inline method** (replace a method with its body at all call sites), and **safe delete** (delete a symbol only | ||
| after verifying it is unused, or propagate the deletion to remove all usages). | ||
|
|
||
| <!-- TODO: Add refactoring demo video here | ||
| <video src="" | ||
| controls | ||
| preload="metadata" | ||
| style="max-width: 100%; height: auto;"> | ||
| Your browser does not support the video tag. | ||
| </video> | ||
| --> | ||
|
|
||
| ## Diagnostics | ||
|
|
||
| Diagnostics expose compiler errors, warnings, and hints to the agent, enabling it to identify and fix issues | ||
| without running external build commands. | ||
|
|
||
| | Capability | Language Server | JetBrains Plugin | | ||
| |---------------------------------------|-----------------|------------------| | ||
| | **File diagnostics** (by line range) | yes | yes | | ||
| | **Symbol diagnostics** (+ references) | yes | yes | | ||
| | **Automatic post-edit diagnostics** | yes | yes | | ||
| | **Quick fixes** | -- | yes | | ||
|
|
||
| Both backends surface compiler errors, warnings, and hints. Serena's editing tools automatically report new diagnostics | ||
| after every edit, giving the agent immediate feedback on whether its changes introduced errors. | ||
|
|
||
| The JetBrains backend provides diagnostics customized to the user's IDE inspection profile and can offer | ||
| **quick fixes** -- automated, one-click resolutions for common issues. | ||
|
|
||
| <!-- TODO: Add diagnostics demo video here | ||
| <video src="" | ||
| controls | ||
| preload="metadata" | ||
| style="max-width: 100%; height: auto;"> | ||
| Your browser does not support the video tag. | ||
| </video> | ||
| --> | ||
|
|
||
| ## Debugging | ||
|
|
||
| Debugging integration is included **only for the JetBrains backend**. | ||
|
|
||
| <!-- TODO: Add debugging demo video here | ||
| <video src="" | ||
| controls | ||
| preload="metadata" | ||
| style="max-width: 100%; height: auto;"> | ||
| Your browser does not support the video tag. | ||
| </video> | ||
| --> | ||
|
|
||
| ## Editing | ||
|
|
||
| Serena provides both symbol-level and file-level editing tools for precise code modifications. | ||
|
|
||
| | Capability | Language Server | JetBrains Plugin | | ||
| |-------------------------------|-----------------|--------------------| | ||
| | **Replace symbol body** | yes | yes | | ||
| | **Insert after symbol** | yes | yes | | ||
| | **Insert before symbol** | yes | yes | | ||
| | **Auto-format after edit** | -- | yes | | ||
|
|
||
| Symbol-level editing is Serena's recommended approach: the agent retrieves a symbol's body, modifies it, and writes | ||
| it back using `replace_symbol_body`. This avoids line-number fragility and ensures precise edits. | ||
|
|
||
| The JetBrains backend automatically **formats code** after every edit using the project's configured code style, | ||
| so the agent doesn't need to worry about indentation or formatting conventions. | ||
|
|
||
| <!-- TODO: Add editing demo video here | ||
| <video src="" | ||
| controls | ||
| preload="metadata" | ||
| style="max-width: 100%; height: auto;"> | ||
| Your browser does not support the video tag. | ||
| </video> | ||
| --> | ||
|
|
||
| ## Basic Features | ||
|
|
||
| Beyond its semantic capabilities, Serena includes a set of basic utilities for completeness. | ||
| When Serena is used inside an agentic harness such as Claude Code or Codex, these tools are typically disabled by default, | ||
| since the surrounding harness already provides overlapping file, search, and shell capabilities. | ||
|
|
||
| - **`search_for_pattern`** -- Flexible regex search across the codebase with glob-based file filtering, context lines, | ||
| and the option to restrict to code files only. Useful when you don't know the exact symbol name. | ||
| - **`list_dir` / `find_file`** -- Directory listing and file search with glob support. Helps agents orient themselves | ||
| in unfamiliar projects. | ||
| - **`read_file`** -- Read files or file chunks by line range, for cases where symbolic access isn't applicable | ||
| (e.g. configuration files, HTML templates). | ||
| - **`execute_shell_command`** -- Run shell commands (builds, tests, linters) directly from the agent, | ||
| with configurable working directory and output limits. | ||
| - **Memories** (`write_memory`, `read_memory`, `list_memory`, `edit_memory`, `delete_memory`, `rename_memory`) -- | ||
| Persistent, Markdown-based project knowledge that survives across sessions. Supports hierarchical topics | ||
| and global (cross-project) memories. | ||
| - **Onboarding** -- Automatic project familiarization on first encounter, storing key information as memories for future use. | ||
| - **Thinking tools** -- Structured reflection prompts (`think_about_collected_information`, `think_about_task_adherence`, | ||
| `think_about_whether_you_are_done`) that improve agent reasoning quality during complex tasks. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo: "qujuality" should be "quality".
There's a spelling error in the word "quality" that should be corrected for professional documentation.
📝 Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 LanguageTool
[grammar] ~17-~17: Ensure spelling is correct
Context: ...SON, keeping token usage low and output qujuality high. - **LLM- and framework-independen...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🤖 Prompt for AI Agents