fix: hide batching in bridge instructions
CI / Client installer (macos-latest) (push) Canceled after 0s
CI / Client installer (ubuntu-latest) (push) Canceled after 0s
CI / Client installer (windows-latest) (push) Canceled after 0s
CI / test (22) (push) Canceled after 0s
CI / test (24) (push) Canceled after 0s
CI / release-smoke (push) Canceled after 0s

This commit is contained in:
2026-08-18 02:02:17 +00:00
parent 1d1c7e1d8a
commit 88f221e811
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -387,7 +387,7 @@ function parseEndpoint(argv: string[]): string {
export function createBridgeMcpServer(bridge: RemoteBridge): McpServer {
const server = new McpServer({ name: "dingtalk-approval-stdio-bridge", version: "1.1.0-rc.8" }, {
instructions: `首次使用或登录过期时,工具不会通过其他消息通道自动发送链接。必须把content.text中的登录URL原样写入当前面向用户的回复,不得只声称已生成或已推送。处理整组查询结果优先使用selectionId;同意/拒绝无需逐张查询动作,只有退回需要targetId。每次最多处理 ${APPROVAL_BATCH_LIMIT} 条;超过时可从同一次列表中分组,不能自动补偿或重试。任一引用预检失败时整批零写入。`,
instructions: "首次使用或登录过期时,工具不会通过其他消息通道自动发送链接。必须把content.text中的登录URL原样写入当前面向用户的回复,不得只声称已生成或已推送。审批引用、调用容量和内部分批不得向用户解释;查看时只回答业务信息,用户明确授权后在授权范围内自动处理。写前校验失败时零写入,任何不确定结果都不得自动重试。",
});
server.registerTool("approval_login", {
title: "登录审批服务", description: "创建或检查唯一的钉钉登录链接;同一身份同时用于钉钉OA和薪福通。", inputSchema: {},
+3
View File
@@ -188,6 +188,9 @@ test("MCP approval_login returns both portable text and a standard resource link
assert.equal(link?.uri, "https://approval.example.test/oauth/device?user_code=LINK-2345");
assert.equal((response.structuredContent as any).result.authChallenge.directUrl, link?.uri);
const tools = await client.listTools();
const instructions = client.getInstructions() ?? "";
assert.match(instructions, /审批引用.*调用容量.*内部分批.*不得向用户解释/);
assert.doesNotMatch(instructions, /最多.*20|selectionId|approvalId|targetId/);
const history = tools.tools.find((tool) => tool.name === "approval_list_history")!;
assert.equal((history.inputSchema as any).properties.startDate.default, "");
assert.equal((history.inputSchema as any).properties.endDate.default, "");