oraios/serena · error · ValueError
No active project
Error message
No active project
What it means
The dashboard's get-memory handler (`_get_memory`) runs a task that calls `agent.get_active_project()`. When no project has been activated, it returns None and the handler raises ValueError('No active project'). Serena requires an active project context before any memory can be loaded.
Solutions
- Activate a project first (call the activate_project tool / equivalent agent API), then retry get_memory.
- Start Serena from within the project directory so a project is auto-activated.
- Check for an active project client-side before calling memory endpoints.
- Verify the project path is correct and loads — an activation failure can leave no active project.
Example fix
// before
callTool("get_memory", {memory_name: "notes"});
// after
if (!hasActiveProject()) callTool("activate_project", {path: "/repo"});
callTool("get_memory", {memory_name: "notes"}); Defensive patterns
Strategy: validation
Validate before calling
active = agent.get_active_project() if hasattr(agent, "get_active_project") else None
if active is None:
activate_project(project_path) # or call the activate_project tool first Type guard
def has_active_project(agent) -> bool:
return agent.get_active_project() is not None Try / catch
try:
resp = requests.get(f"{dashboard}/get_memory", params={"memory_name": name})
resp.raise_for_status()
except ValueError:
activate_project(project_path)
resp = requests.get(f"{dashboard}/get_memory", params={"memory_name": name}) Prevention
- Always activate a project before any memory endpoint call.
- Start the agent from within the project directory so activation is automatic.
- Check the active project via get_active_project or the dashboard state before memory operations.
- Confirm project activation succeeded (path has valid .serena config) before proceeding.
When it happens
Trigger: Calling the dashboard /get_memory endpoint while the agent has no active project — e.g. before `activate_project` was ever called, or after switching/shutdown cleared the active project.
Common situations: Tools or clients invoking memory endpoints on a fresh Serena session without activating a project; sessions started outside a project directory; the active project failing to load at startup.
Related errors
- Config overview not yet available
- Invalid language server identifier
- Invalid language server identifier
- Serena config file not found
- Serena config file path not set
AI-assisted analysis of oraios/serena@7fcbca7e62 (2026-08-29).
Data as JSON: /api/errors/b1f6f83486f24bac.
Report an issue: GitHub.
Appendix: source
Thrown at src/serena/dashboard.py:661
all_languages = [lang.value for lang in LanguageServerId.iter_all(include_experimental=True)]
# Filter out already added languages for the active project
project = self._agent.get_active_project()
if project:
current_languages = [lang.value for lang in project.project_config.language_servers]
available_languages = [lang for lang in all_languages if lang not in current_languages]
else:
available_languages = all_languages
return ResponseAvailableLanguages(languages=sorted(available_languages))
return self._agent.execute_task(run, logged=False)
def _get_memory(self, request_get_memory: RequestGetMemory) -> ResponseGetMemory:
def run() -> ResponseGetMemory:
project = self._agent.get_active_project()
if project is None:
raise ValueError("No active project")
content = project.memory_manager.load_memory(request_get_memory.memory_name)
return ResponseGetMemory(content=content, memory_name=request_get_memory.memory_name)
return self._agent.execute_task(run, logged=False)
def _save_memory(self, request_save_memory: RequestSaveMemory) -> None:
def run() -> None:
project = self._agent.get_active_project()
if project is None:
raise ValueError("No active project")
project.memory_manager.save_memory(request_save_memory.memory_name, request_save_memory.content, is_tool_context=False)
self._agent.execute_task(run, logged=True, name="SaveMemory")
def _delete_memory(self, request_delete_memory: RequestDeleteMemory) -> None:
def run() -> None:
project = self._agent.get_active_project()View on GitHub (pinned to 7fcbca7e62)