oraios/serena · error · ToolCallError
No active project. Ask the user to provide the project path
Error message
No active project. Ask the user to provide the project path or to select a project from this list of known projects: {self.agent.serena_config.project_names} What it means
Tools that require project context (anything not marked ToolMarkerDoesNotRequireActiveProject) fail in task() when the agent has no active project loaded. The error tells the caller to ask the user for a project path or choose from serena_config.project_names.
Source
Thrown at src/serena/tools/tools_base.py:369
except Exception as e:
log.info(f"Failed to get client info: {e}.")
def task() -> str:
apply_fn = self.get_apply_fn()
try:
if not self.is_active():
raise ToolCallError(
f"Tool '{self.get_name_from_cls()}' is not active. Active tools: {self.agent.get_active_tool_names()}"
)
if log_call:
self._log_tool_application(inspect.currentframe(), session_id)
# check whether the tool requires an active project and language server
if not isinstance(self, ToolMarkerDoesNotRequireActiveProject):
if self.agent.get_active_project() is None:
raise ToolCallError(
"No active project. Ask the user to provide the project path or to select a project from this list of known projects: "
+ f"{self.agent.serena_config.project_names}"
)
# construct apply kwargs, adding session_id if the tool is session-aware
apply_kwargs = dict(kwargs)
if self._is_session_aware:
apply_kwargs["session_id"] = session_id
# apply the actual tool
try:
result = apply_fn(**apply_kwargs)
except SolidLSPException as e:
if e.is_language_server_terminated():
affected_language = e.get_affected_language()
if affected_language is not None:
log.error(
f"Language server terminated while executing tool ({e}). Restarting the language server and retrying ..."View on GitHub (pinned to 7fcbca7e62)
Solutions
- Activate a project first (agent.select_project('/path/to/project') or the activate_project tool)
- Ask the user for the project path and load it before issuing tool calls
- Pick a project from agent.serena_config.project_names (the message lists known ones)
- Use a tool marked as not requiring an active project if that fits the intent
Example fix
// before agent.get_tool(ListDirTool).apply(path='src') # no active project // ToolCallError: No active project... // after agent.get_tool(ActivateProjectTool).apply(project='/home/me/myrepo') agent.get_tool(ListDirTool).apply(path='src')
Defensive patterns
Strategy: validation
Validate before calling
if agent.get_active_project() is None:
known = agent.serena_config.project_names
raise NeedProjectInput(f'select one of: {known}')
result = tool.apply(...) Try / catch
try:
result = tool.apply(...)
except ToolCallError as e:
if 'No active project' in str(e):
agent.get_tool(ActivateProjectTool).apply(project=ask_user_or_pick())
result = tool.apply(...)
else:
raise Prevention
- Activate a project at session start before any project-scoped tool call
- Wrap tool dispatch to lazily activate the last-used project
- For project-independent work, use tools marked ToolMarkerDoesNotRequireActiveProject
When it happens
Trigger: Calling any file/symbol/memory tool before select_project/onboarding; the active project was deactivated; a fresh agent session where no project was ever set.
Common situations: Chat starts and the agent immediately calls find_file without activating a project; multi-project setups where the wrong agent instance is used; project activation failed silently earlier.
Related errors
- Tool '{self.get_name_from_cls()}' is not active. Active tool
- Context file not found: {path.resolve()}
- Cannot use both fixed_tools and excluded_tools/included_opti
- Unknown language backend '{backend_str}': valid values are {
- Invalid line_ending: {value!r}. Valid values are: {valid}
AI-assisted analysis of oraios/serena@7fcbca7e62 (2026-08-29).
Data as JSON: /api/errors/d3c4e876c5531408.
Report an issue: GitHub.