chore: nothing special, subagent enhanced
This commit is contained in:
@@ -185,9 +185,8 @@ class NanobotIntegration:
|
||||
agent.tools.register(NL2SQLTool())
|
||||
agent.tools.register(VisualizationTool())
|
||||
agent.tools.register(GetDatabaseSchemaTool())
|
||||
if project_id is not None:
|
||||
agent.tools.register(ListSubagentsTool(project_id=project_id))
|
||||
agent.tools.register(InvokeSubagentTool(project_id=project_id))
|
||||
agent.tools.register(ListSubagentsTool(project_id=project_id))
|
||||
agent.tools.register(InvokeSubagentTool(project_id=project_id))
|
||||
|
||||
def _build_provider(
|
||||
self,
|
||||
@@ -357,9 +356,9 @@ class NanobotIntegration:
|
||||
|
||||
if project_id is None:
|
||||
from app.core.session_alias_store import session_alias_store
|
||||
alias_info = session_alias_store.get_alias(session_id)
|
||||
if alias_info and alias_info.get("project_id"):
|
||||
project_id = alias_info.get("project_id")
|
||||
alias_meta = session_alias_store.get_alias_meta(session_id)
|
||||
if alias_meta and alias_meta.get("project_id") is not None:
|
||||
project_id = alias_meta.get("project_id")
|
||||
|
||||
agent_to_use = self.agent
|
||||
need_custom_agent = False
|
||||
|
||||
@@ -173,6 +173,22 @@ class SessionAliasStore:
|
||||
alias = row["alias"]
|
||||
return str(alias) if alias else None
|
||||
|
||||
def get_alias_meta(self, session_key: str) -> dict[str, Any] | None:
|
||||
with self._connect() as conn:
|
||||
row = conn.execute(
|
||||
"SELECT alias, pinned, archived, project_id FROM session_cache WHERE session_key = ?",
|
||||
(session_key,),
|
||||
).fetchone()
|
||||
if not row:
|
||||
return None
|
||||
alias = (row["alias"] or "").strip()
|
||||
return {
|
||||
"alias": alias or None,
|
||||
"pinned": bool(row["pinned"]) if "pinned" in row.keys() else False,
|
||||
"archived": bool(row["archived"]) if "archived" in row.keys() else False,
|
||||
"project_id": row["project_id"] if "project_id" in row.keys() else None,
|
||||
}
|
||||
|
||||
def delete_session(self, session_key: str) -> None:
|
||||
with self._connect() as conn:
|
||||
conn.execute("DELETE FROM session_cache WHERE session_key = ?", (session_key,))
|
||||
|
||||
Reference in New Issue
Block a user