From 017c900b2b7ac8b86b4b9ece573db5d5aa7dabb5 Mon Sep 17 00:00:00 2001 From: Philipp Winterle Date: Fri, 19 Dec 2025 12:24:39 +0100 Subject: [PATCH 01/67] feat: Add tool cache invalidation with differential update logic and manual discovery trigger (#208) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(api): add server tool discovery functionality and auto cache invalidation of tools - Implemented `discoverServerTools` method in APIService to trigger tool discovery for a specified server. - Updated ServerDetail.vue to include a button for discovering tools, enhancing user interaction. - Added backend support for tool discovery in the ServerController and integrated it into the routing. - Introduced `GetToolsByServer` method in the index manager to retrieve tools associated with a server. - Enhanced the OpenAPI documentation to reflect the new endpoint for tool discovery. This feature allows users to manually trigger tool discovery, improving the management of server tools. * fix: add missing DiscoverServerTools and GetToolsByServer to test mocks - Add DiscoverServerTools method to MockServerController in contracts_test.go - Add DiscoverServerTools method to baseController in security_test.go - Add GetToolsByServer to TestIndexManagerContract expected methods These methods were added to the interfaces in this PR but the test mocks were not updated, causing CI failures. šŸ¤– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --------- Co-authored-by: Algis Dumbris Co-authored-by: Claude Opus 4.5 --- frontend/src/services/api.ts | 6 + frontend/src/views/ServerDetail.vue | 43 +++ internal/appctx/contracts_test.go | 5 + internal/appctx/interfaces.go | 1 + internal/httpapi/contracts_test.go | 5 + internal/httpapi/security_test.go | 3 + internal/httpapi/server.go | 45 +++ internal/index/bleve.go | 38 +++ internal/index/manager.go | 8 + internal/runtime/lifecycle.go | 169 ++++++++++- internal/runtime/tool_invalidation_test.go | 330 +++++++++++++++++++++ internal/server/server.go | 6 + internal/upstream/core/client.go | 5 + oas/docs.go | 2 +- oas/swagger.yaml | 42 +++ 15 files changed, 701 insertions(+), 7 deletions(-) create mode 100644 internal/runtime/tool_invalidation_test.go diff --git a/frontend/src/services/api.ts b/frontend/src/services/api.ts index 17d75e22..ebb2e87d 100644 --- a/frontend/src/services/api.ts +++ b/frontend/src/services/api.ts @@ -243,6 +243,12 @@ class APIService { }) } + async discoverServerTools(serverName: string): Promise { + return this.request(`/api/v1/servers/${encodeURIComponent(serverName)}/discover-tools`, { + method: 'POST', + }) + } + async deleteServer(serverName: string): Promise { return this.callTool('upstream_servers', { operation: 'remove', diff --git a/frontend/src/views/ServerDetail.vue b/frontend/src/views/ServerDetail.vue index 73e96b02..0fecd8b8 100644 --- a/frontend/src/views/ServerDetail.vue +++ b/frontend/src/views/ServerDetail.vue @@ -86,6 +86,12 @@ OAuth Login +
  • + +
  • +
  • +
  • + +
  • + + @@ -94,6 +125,19 @@ + +
    + + +
    +