fix: shorten OpenCode temporary MCP tool names and keep them stable per conversation

Use gbd-/gbc- prefixes with a 6-char conversation hash instead of 20-char per-request hashes, lease per-conversation slots so parallel requests never share a name, and expose gateway custom tools as <server hash>_<name> within the 64-char provider limit.
This commit is contained in:
mesalogo
2026-09-30 17:32:26 +08:00
parent 7fb23d9b6b
commit 80edd15438
6 changed files with 334 additions and 43 deletions
+2 -2
View File
@@ -77,7 +77,7 @@ import type {
ResolvedMcpServer
} from '../capabilities/capability-service'
import {
createMcpToolName,
createGatewayMcpToolName,
isValidMcpToolName,
listAllMcpTools,
normalizeMcpToolSchema
@@ -848,7 +848,7 @@ export class KnowledgeMcpGateway {
>(normalizeMcpToolSchema(tool.outputSchema))
: undefined,
exposedTool: {
name: createMcpToolName(server.id, tool.name),
name: createGatewayMcpToolName(server.id, tool.name),
title: `${server.name} / ${tool.name}`.slice(0, 200),
description: [
`GoodBuddy 代理的自定义 MCP Server「${server.name}」工具。`,