From 0d9c2b3532f0645f8ce55b10f6809b5e19cbc442 Mon Sep 17 00:00:00 2001 From: matevip Date: Tue, 23 Jun 2026 18:22:22 +0800 Subject: [PATCH] feat(agent): register SessionListTool as a built-in tool (three dialects) --- .../migration/h2/V157__register_session_list_tool.sql | 10 ++++++++++ .../kingbase/V157__register_session_list_tool.sql | 10 ++++++++++ .../mysql/V157__register_session_list_tool.sql | 10 ++++++++++ 3 files changed, 30 insertions(+) create mode 100644 mateclaw-server/src/main/resources/db/migration/h2/V157__register_session_list_tool.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/kingbase/V157__register_session_list_tool.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/mysql/V157__register_session_list_tool.sql diff --git a/mateclaw-server/src/main/resources/db/migration/h2/V157__register_session_list_tool.sql b/mateclaw-server/src/main/resources/db/migration/h2/V157__register_session_list_tool.sql new file mode 100644 index 00000000..10d6e4df --- /dev/null +++ b/mateclaw-server/src/main/resources/db/migration/h2/V157__register_session_list_tool.sql @@ -0,0 +1,10 @@ +-- V157: Register SessionListTool as a built-in tool. +-- Mirrors DelegateAgentTool (spawn) so the delegation tools surface together in +-- the tool picker and AvailableToolService. SessionListTool is read-only and +-- core-tier (auto-available even without this row); this row gives it a name, +-- icon and admin toggle in the UI. +-- Idempotent: MERGE INTO updates existing rows when id matches. + +MERGE INTO mate_tool (id, name, display_name, description, tool_type, bean_name, icon, enabled, builtin, create_time, update_time, deleted) +KEY (id) +VALUES (1000000024, 'SessionListTool', 'Sub-Agent List', 'List the live sub-agents spawned from the current conversation: id, target agent, depth, status, phase, tool-call count, elapsed time and goal. Read-only; lets a parent agent check delegated children before deciding to wait, follow up, or proceed.', 'builtin', 'sessionListTool', '🧭', TRUE, TRUE, NOW(), NOW(), 0); diff --git a/mateclaw-server/src/main/resources/db/migration/kingbase/V157__register_session_list_tool.sql b/mateclaw-server/src/main/resources/db/migration/kingbase/V157__register_session_list_tool.sql new file mode 100644 index 00000000..3383b706 --- /dev/null +++ b/mateclaw-server/src/main/resources/db/migration/kingbase/V157__register_session_list_tool.sql @@ -0,0 +1,10 @@ +-- V157: Register SessionListTool as a built-in tool. +-- Mirrors DelegateAgentTool (spawn) so the delegation tools surface together in +-- the tool picker and AvailableToolService. SessionListTool is read-only and +-- core-tier (auto-available even without this row); this row gives it a name, +-- icon and admin toggle in the UI. +-- Idempotent: ON CONFLICT keeps the row in sync if it already exists. + +INSERT INTO mate_tool (id, name, display_name, description, tool_type, bean_name, icon, enabled, builtin, create_time, update_time, deleted) +VALUES (1000000024, 'SessionListTool', 'Sub-Agent List', 'List the live sub-agents spawned from the current conversation: id, target agent, depth, status, phase, tool-call count, elapsed time and goal. Read-only; lets a parent agent check delegated children before deciding to wait, follow up, or proceed.', 'builtin', 'sessionListTool', '🧭', TRUE, TRUE, NOW(), NOW(), 0) +ON CONFLICT (id) DO UPDATE SET name=EXCLUDED.name, display_name=EXCLUDED.display_name, description=EXCLUDED.description, tool_type=EXCLUDED.tool_type, bean_name=EXCLUDED.bean_name, icon=EXCLUDED.icon, enabled=EXCLUDED.enabled, builtin=EXCLUDED.builtin, update_time=EXCLUDED.update_time, deleted=EXCLUDED.deleted; diff --git a/mateclaw-server/src/main/resources/db/migration/mysql/V157__register_session_list_tool.sql b/mateclaw-server/src/main/resources/db/migration/mysql/V157__register_session_list_tool.sql new file mode 100644 index 00000000..ac159ec3 --- /dev/null +++ b/mateclaw-server/src/main/resources/db/migration/mysql/V157__register_session_list_tool.sql @@ -0,0 +1,10 @@ +-- V157: Register SessionListTool as a built-in tool. +-- Mirrors DelegateAgentTool (spawn) so the delegation tools surface together in +-- the tool picker and AvailableToolService. SessionListTool is read-only and +-- core-tier (auto-available even without this row); this row gives it a name, +-- icon and admin toggle in the UI. +-- Idempotent: ON DUPLICATE KEY UPDATE keeps the row in sync if it already exists. + +INSERT INTO mate_tool (id, name, display_name, description, tool_type, bean_name, icon, enabled, builtin, create_time, update_time, deleted) +VALUES (1000000024, 'SessionListTool', 'Sub-Agent List', 'List the live sub-agents spawned from the current conversation: id, target agent, depth, status, phase, tool-call count, elapsed time and goal. Read-only; lets a parent agent check delegated children before deciding to wait, follow up, or proceed.', 'builtin', 'sessionListTool', '🧭', TRUE, TRUE, NOW(), NOW(), 0) +ON DUPLICATE KEY UPDATE name=VALUES(name), display_name=VALUES(display_name), description=VALUES(description), tool_type=VALUES(tool_type), bean_name=VALUES(bean_name), icon=VALUES(icon), enabled=VALUES(enabled), builtin=VALUES(builtin), update_time=VALUES(update_time), deleted=VALUES(deleted);