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
+1 -1
View File
@@ -1079,7 +1079,7 @@ describe('KnowledgeMcpGateway', () => {
expect(listed.tools).toEqual([
expect.objectContaining({
name: expect.stringMatching(
/^mcp_[a-f0-9]{8}_[a-f0-9]{8}_echo_private$/u
/^[a-f0-9]{4}_echo_private$/u
),
description: expect.stringContaining('Private MCP')
})