From e138e0c81a91c995d79db6b3d6c9781681255778 Mon Sep 17 00:00:00 2001 From: wizardchen Date: Fri, 20 Mar 2026 13:29:11 +0800 Subject: [PATCH] refactor(agent): remove query display from DatabaseQuery component and update tool result structure - Removed the query display section from the DatabaseQuery component to streamline the UI. - Updated the DatabaseQueryData interface to eliminate the query field, reflecting changes in tool result handling. - Enhanced the DatabaseQuery tool execution to focus on returning structured results without exposing raw SQL queries. - Added a new utility to strip blocks from LLM outputs, improving content clarity and user experience. --- frontend/src/types/tool-results.ts | 1 - .../components/tool-results/DatabaseQuery.vue | 36 --------- internal/agent/act.go | 53 ++++++++++++- internal/agent/engine.go | 2 +- internal/agent/observe.go | 26 ++++++- internal/agent/think.go | 3 + internal/agent/tools/database_query.go | 9 +-- internal/agent/tools/strip_think.go | 37 +++++++++ internal/agent/tools/strip_think_test.go | 56 ++++++++++++++ internal/application/service/agent_service.go | 9 ++- internal/event/event_data.go | 1 + internal/utils/inject.go | 77 +++++++++++++++++-- 12 files changed, 253 insertions(+), 57 deletions(-) create mode 100644 internal/agent/tools/strip_think.go create mode 100644 internal/agent/tools/strip_think_test.go diff --git a/frontend/src/types/tool-results.ts b/frontend/src/types/tool-results.ts index aeb85481..844df701 100644 --- a/frontend/src/types/tool-results.ts +++ b/frontend/src/types/tool-results.ts @@ -154,7 +154,6 @@ export interface DatabaseQueryData { columns: string[]; rows: Array>; row_count: number; - query: string; } // Web search result item diff --git a/frontend/src/views/chat/components/tool-results/DatabaseQuery.vue b/frontend/src/views/chat/components/tool-results/DatabaseQuery.vue index 48e81c20..d7f67d86 100644 --- a/frontend/src/views/chat/components/tool-results/DatabaseQuery.vue +++ b/frontend/src/views/chat/components/tool-results/DatabaseQuery.vue @@ -1,17 +1,6 @@